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 -

plugins - CodeIgniter support on netbeans 8.0 -

php - Selecting items from MySQL for a status update feed efficiently while accounting for possible spam -