tolocalestring javascript currency fixing 2 decimal places

Solutions on MaxInterview for tolocalestring javascript currency fixing 2 decimal places by the best coders in the world

showing results for - "tolocalestring javascript currency fixing 2 decimal places"
Giulia
25 Mar 2017
1var num = 2046430;
2num.toLocaleString(undefined, {minimumFractionDigits: 2}) // 2,046,430.00
3
Maybell
06 Jun 2017
1var num = 2046430.123;
2num.toLocaleString(undefined, {
3  minimumFractionDigits: 2,
4  maximumFractionDigits: 2
5}) // 2,046,430.12
6
Sofia
16 May 2017
1var num = 2046430.123;
2num.toLocaleString(undefined, {
3  maximumFractionDigits: 0
4})