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

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

mysqli - Php Mysqli_fetch_assoc Error : "Warning: Illegal string offset 'name' in" -

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