I am using material-ui
to render a TextField
component in my react
app. It's somehow forcing all the <TextField type="number />
to have decimal separator as comma (,) instead of dot (.) which is confusing for the targeted users.
Is there any way to force it to always show dot as the decimal separator, regardless of locale?
I have created a small example here. just try to enter a number with decimals and click outside and it'll convert it into comma. This is probably because of my current device locale, but still I want to force a dot for everyone.
For me, setting the language attribute to "en-US"
in the inputProps
worked:
<TextField
type="number"
inputProps={{step: "0.1", lang:"en-US"}}
/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With