Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript round to 1 decimal

var subTotal="12.1345";// can also be int, float, string
var subTotalFormatted=parseFloat(subTotal).toFixed(2); //"12.13"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #decimal
ADD COMMENT
Topic
Name
8+9 =