1

Using AngularJS, I have a number field <input type="number" ng-model="requisite.values.cost">. Is it possible to automatically format this field, separating the thousands with a space?

Meaning, so that when the value requisite.values.cost is 1000000, it will display in the number field 1 000 000, for easier readability.

3
  • Example of input field formatting: stackoverflow.com/questions/19094150/… Commented Apr 20, 2018 at 19:43
  • Thank you for your link Zaxxon, though it's regarding a text field, as in input type="text", as opposed to input type="number". Would it be the same with a number field? Commented Apr 21, 2018 at 5:53
  • 1
    I think you'd have to do it in a text field to get custom formatting. Of course, you'd have to handle the conversion into a number for use in your back end. Commented Apr 26, 2018 at 16:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.