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 - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -