Convert String with Dot or Comma as decimal separator to number in JavaScript
-
31-10-2019 - |
문제
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'
'110 000,23'
'100 1.23'
How would one convert them to a float number in the browser using JavaScript?
jQuery and jQuery UI are used. Number(string)
returns NaN and parseFloat()
stops on first space or comma.
올바른 솔루션이 없습니다
제휴하지 않습니다 StackOverflow