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

html - Cut text on left side inside button while centering -

java - Last square of 8x8 grid not drawn, using two nested FOR loops -

What design pattern is this code in Javascript? -