How auto format input number with currency mask (Ionic)

12,300

Solution 1

look at this angular modules and directives:

http://aguirrel.github.io/ng-currency/

jsfiddle.net/odiseo/dj6mX/

http://assisrafael.github.io/angular-input-masks/

Solution 2

Look at this plugin for jQuery jquery-numberformatter:

$(this).parseNumber({format:"#,###.00", locale:"us"});

Solution 3

I know your pain, I've seen a couple of solutions:

Share:
12,300
Willian Custódio
Author by

Willian Custódio

Updated on August 21, 2022

Comments

  • Willian Custódio
    Willian Custódio over 1 year

    I need to create a currency mask (right to left) in a input=number of my mobile app (Ionic + Cordova). If the user enter with 123456 value, the input should be 1.234,56 (adding "," and "." automatically).

    I don't know how to do this with HTML and Javascript.

    Anybody help me?

    Noting that input type should be "number", to show only numeric keyboard in device.

    Sorry my poor english