var x = 5.0364342423;
parseFloat(x.toFixed(2));
//VS
Math.round(x*100)/100; // 97% faster
Created
March 16, 2016 23:00
-
-
Save dr-dimitru/e7941380efe34be1b1cb to your computer and use it in GitHub Desktop.
Speed-test of trimming float number
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment