Petya Naumova
Petya Naumova

Reputation: 725

Decimal dot and thousands separator used both in input type number

How is possible to use both decimal dot and thousands separator in input type="number", more specifically within AngularJS model? For example, the numeric value the user be able to write, should look like this: 3,597.50. Also, I have to make a check if the entered data is a number or a string which I make with isNaN(). I tried someNumber.toFixed(2), where someNumber is a variable, containing the number which the user has entered but it doesn't work.

Upvotes: 0

Views: 497

Answers (1)

Gustavo Gabriel
Gustavo Gabriel

Reputation: 1296

Have you tried https://github.com/aguirrel/ng-currency ?

Its pretty decent...

Upvotes: 1

Related Questions