I would like to be able to move the decimal point 2 places over an unknown number of numbers without using math. I know this seems odd, but the ultimate accuracy causes some shifts. My javascript is not strong, but I would really like to know how to chop a number and do it if possible. Thus, I hope that great people will help you.
Problem:
- 575/960 = 0.5989583333333334 using the console
- I would like to make a copy and passive percentage: 59.8958333333333434%
- If I use math and multiply it by 100, it returns 59.895833333333336 because of the finite precision
Is there a way to make this line and just move the decimal 2 places to the right to skip the math?
Here is also a fiddle with codes: http://jsfiddle.net/dandenney/W9fXz/
If you want to know why I need this and want accuracy, this is for this small tool that I did to get percentage answers without using a calculator: http://responsv.com/flexible-math
source
share