9/29/2011 12:24:00 AM
Title:
Round off number 3 decimal place
Hi
Can you please help me:
I want to round off this number upto 3 decimal place
Input: 0.0002777777777777778
Required Output: 0.001
Input: 0.0005555555555555556
Required Output: 0.001
Input: 0.0008333333333333334
Required Output: 0.001
Input: 0.0011111111111111111
Required Output: 0.002
I hope you understand my requirement whatever in the fourth place of decimal we have to increment the value in third decimal place.
Sorry for my English.
Thanks
Tyler
Points: 430
Posts:0
9/29/2011 6:18:06 AM
its quite simple logic . If you want to round Off at third decimal place. You just need to check the 4th number if its greater than 0 then simply add one to 3rd number. Discard the remaining numbers after 3 position. Let me know if you have difficulty in building logic. I will do that for you.