What is the decimal separator symbol in JavaScript?

后端 未结 3 1736
野性不改
野性不改 2020-11-28 08:19

A thought struck me as I was writing a piece of JavaScript code that processed some floating point values. What is the decimal point symbol in JavaScript? Is it always

3条回答
  •  执笔经年
    2020-11-28 09:11

    use:

    theNumber.toLocaleString();
    

    to get a properly formatted string with the right decimal and thousands separators

提交回复
热议问题