You need to sign in to do that
Don't have an account?
TehNrd
How to round a number to two decimal places?
Part of this is me struggling with the syntax and the other part is me not knowing what system method to use. A decimal method, math method?
oli.TotalPrice will equal 2990.504 but I would like to round this to only two decimal places so the value is 2990.50
Code:
Decimal parentlistPrice = 9995.00 Decimal svcPercent = .17 Decimal discount = .88 //oli.quantity = 2.0 oli.TotalPrice = ((parentListPrice * svcPercent) * discount) * oli.Quantity;
oli.TotalPrice will equal 2990.504 but I would like to round this to only two decimal places so the value is 2990.50
Here is the correct code:
All Answers
http://www.salesforce.com/us/developer/docs/apexcode/index.htm
Cheers,
Ryan
Here is the correct code:
thanks, I was going crazy on fig-ing this out ..
Hi People,
Is there any way i can use it for input fields too?
Here is the problem im having:
I enter a decimal value 10 for an inputfield and click next to go to another block. and when i click back..the input field shows '10.0' instead of '10.00' even though im using setscale(2). any thoughts on this?