lagden / currency

The simple and tiny script for currency input mask
https://codepen.io/lagden/pen/jOrZVjg?editors=1010
MIT License
16 stars 2 forks source link

Masking of values for currency ISK and JPY always results in `0` #9

Closed matthiasschaub closed 6 months ago

matthiasschaub commented 7 months ago

Reproducible by changing the currency of the CodePen example to ISK and trying out the input field.

new Currency(input, {
    maskOpts: {
        empty: true,
        locales: 'de-DE',
        options: {
            style: 'currency',
            currency: 'ISK'
        }
    }
})

After setting currency to ISK, no matter what number are typed in the input field always show 0.

image

I love this little gem of yours. It's exactly what I need and so small :) Thanks for creating and sharing currency. I hope this can be fixed at some point. I am not proficient in JavaScript otherwise I would have dug into the code myself and find out the problem.

lagden commented 6 months ago

Hi @matthiasschaub

I fixed and added the ISK and JPY currency on codepen. Enjoy and confirm if is correctly.

https://codepen.io/lagden/pen/jOrZVjg

matthiasschaub commented 6 months ago

Awesome. I can confirm that it works now! Thank you.