Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

tolocalestring javascript currency fixing 2 decimal places

var num = 2046430.123;
num.toLocaleString(undefined, {
  minimumFractionDigits: 2,
  maximumFractionDigits: 2
}) // 2,046,430.12
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #tolocalestring #javascript #currency #fixing #decimal #places
ADD COMMENT
Topic
Name
3+1 =