2 decimals in JavaScript with out regular expression and without rounding the numbers -


this question has answer here:

can give me code accepting 2 decimals using javascript. without regular expression , without jquery. number should not round.

to fixed

use tofixed(2); doing that

var num = 2.4; alert(num.tofixed(2));  alert 2.40 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -