Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- If the value < 0.0:
- Insert - into string
- Subtract value from 0.0 to make it positive.
- While the value <= 10.0:
- Divide by 10
- Increment decimal counter
- For each digit of required precision:
- Take the integer portion of the value and place it in the string
- Decrement decimal counter
- If decimal counter is 0:
- Insert decimal point
- Multiply the value by 10.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement