header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Arvind
Points:0
Posts:0

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



1
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.


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 1+6 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions