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

Rounding a number
Hi All,
I need to round numbers similar to the example below.
5.2 should be rounded to 5
5.3 to 5.7 should be rounded to 5.5
Greater than 5.7 to 6.
Is there any formula function or known way to do this?
Help me in this.
Thanks !!
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_decimal.htm
Thanks
Utsav
[Do mark this answer as solution if it works for you and give a kudos.]
The only thing I can think of that would allow you to do this in a formula field would be something like this:
Subtracting FLOOR( Number__c ) from the number gives you the decimal value.
If the decimal value is less than 0.2, return FLOOR( Number__c ) -- rounding down.
If the decimal value is greater than 0.7, return CEILING( Number__c ) -- rounding up.
Otherwise, returning FLOOR( Number__c ) + 0.5 gives you N.5.