June 4, 2013
Best method to get double value from datetime in jquery
User2451211’s Question:
Which is the best way to convert datetime to double in jquery? I have used Date.parse. But, it is not correct in few cases. Also,i am unable to pass datetime format for that method.
–
Viji
In JavaScript, you can simple do variablename.toFixed(2);
for that.
Example:
var num1 = 12312.12312
console.log(num1.toFixed(2)); // Will give 12312.12