Convert String with Dot or Comma as decimal separator to number in JavaScript

后端 未结 11 768
时光取名叫无心
时光取名叫无心 2020-12-03 04:26

An input element contains numbers a where comma or dot is used as decimal separator and space may be used to group thousands like this:

\'1,2\'

11条回答
  •  长情又很酷
    2020-12-03 04:52

    The perfect solution

    accounting.js is a tiny JavaScript library for number, money and currency formatting.

    Check this for ref

提交回复
热议问题