المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How come I get a rounded number when I multiply doubles??



C# Programming
07-27-2010, 07:13 PM
How come I get a rounded number when I multiply and assign value to a double??

dbRecipeTotal = (RI.Quantity / dbRecipeTotalQuantity) * (InvItem.Price / 100);

double dbRecipeTotal = 0.0;
RI.Quantity is = 28.88887dbRecipeTotalQuantity is = 28.88887InvItem.Price is = 2425
I get dbRecipeTotal = 12.0 in quickview

it should be 24.25

Any help is appreaciated