get decimal for javascript

if you have a string and want convert to decimal, you can use this :
var dian = “12.05”;
var purnomo = (parseFloat(dian)).toFixed(2);

and the result is => 12.05

NB : parseFloat is convert from string to float value
and toFixed(2) is the precision for your decimal value.

this is a simple way….i thik’s… 🙂