jsillitoe / react-currency-input

React component for inputing currency amounts
MIT License
203 stars 163 forks source link

Export mask function #86

Closed bazk closed 2 years ago

bazk commented 6 years ago

I've stumbled upon a case in which the mask function is useful by itself.

What I needed was to generate a plain text output of a currency, but formatted exactly like in the input component (same precision, decimalSeparator, etc.). By exporting the mask function, I can just import that and call it with the same parameters as I did for the input component, and voilà: we have a formatted, plain text output.