mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.85k stars 32.25k forks source link

[NumberInput] Automatic currency formatting #35664

Open hceliberty opened 1 year ago

hceliberty commented 1 year ago

Summary 💡

A Textfield which will get an number (amount in cents) and the input will format it in dollars or euros or whatever currency, according to the currency or the local given to the Input threw a prop

Examples 🌈

It will do something like this. An npm package do already this but it is no longer maintained. Here is the github repository (https://github.com/unicef/material-ui-currency-textfield) material-ui-currency-field

Motivation 🔦

Currently I am building a admin interface in which i have to edit prices. As usual the API i'm using return to me currecy in cents and i would like to edit the amount in dollars/euro and sumbmit it again in cents to the API

hbjORbj commented 1 year ago

Please provide a Codesandbox with a sample snippet of the code that precisely reproduces the issue. You can fork this template: https://material-ui.com/r/issue-template-latest

hceliberty commented 1 year ago

It is not an issue, I just provied a feature than may implement in the future

michaldudak commented 1 year ago

We may consider it in the future if there is significant interest from the community (measured by the number of upvotes).

scath999 commented 4 months ago

Note: The plugin the OP cites doesn't work and play well with VITE v5.3.2 - unsure if it works with earlier revisions.

This would be a helpful feature for people dealing with money inputs, since TextField doesn't appear to have support for currency.

cykoder commented 3 months ago

+1 to this feature