You need to sign in to do that
Don't have an account?

Two Decimal Places Formatting
Hi,
I work with Decimal values and after performing some calculations I alway end up with numbers like 1.235555555
I need to limit my Decimal to precision to only 2 decimal places after the decimal point.
I don't seem to find method that does that.
Any ideas, I am sure is simple :)
Forgot to mention: This is entirely in Apex code!
Thank you.
Use the setScale() Methods to specify the number of Decimals
eg:
Decimal d = 10.032222;
System.debug(d.SetSCale(2));
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_decimal.htm
All Answers
Use the setScale() Methods to specify the number of Decimals
eg:
Decimal d = 10.032222;
System.debug(d.SetSCale(2));
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_decimal.htm
Thank you, I was using the setScale method however I did not know to use it only when looking at the var/
That works for me, thanks again.