ngx-currency
ngx-currency copied to clipboard
Feature request: parsing to value in cents
Hello,
I'd like to suggest an enhancement for the monetary input component of your library. Typically, monetary values are stored as integers, representing the smallest unit of a currency (like cents in the case of dollars or pence for pounds). This approach helps in avoiding floating-point precision issues.
Suggestion: It would be highly beneficial if the component could automatically handle the conversion of entered monetary values into their integer representation. This feature would streamline the process of handling monetary inputs, ensuring that values are accurately and consistently stored in their smallest unit format.
Example: When a user enters a value like $10.25, the component would automatically parse and convert this into 1025.
@Arthur-Carbonari Unfortunately, the author of this library is not developing new features https://github.com/nbfontana/ngx-currency/pull/169#issuecomment-1636160301. I think the fastest way would be to do it yourself and open a PR. The author promised to pay some attention to the release of new versions.