You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The defaults of numeral are not useful, and there is currently no way to set numeral.language
E.g.
var french = {
delimiters: {
thousands: ' ',
decimal: ','
},
...
};
<NumberInput
numeralLang={french} ...
The text was updated successfully, but these errors were encountered:
andrewkolesnikov
changed the title
You neither expose nor allow to set numeral.language
You neither expose numeral nor allow to set numeral.language
Jan 26, 2016
andrewkolesnikov
changed the title
You neither expose numeral nor allow to set numeral.language
numeral is neither exposed nor setting numeral.language is allowed
Jan 26, 2016
At the moment numeral js only supports setting the language globally rather than per use. They have a few open issues about this but can't see anything about whether it is going to be added any time soon.
Are you after different locale settings per number input component or more on a application scale?
It would probably end up looking something like the below rather than as a property of the number input component I would imagine:
import NumberInput, {locale} from 'react-number-input'
locale('fr')
I'm not sure if this approach is the best though as you'd now have this affecting every component in your application no matter where this was set.
I've created a PR for this with numeral js though I'm getting the feeling it isn't too well supported these days. Will keep an eye on it and see if there is any movement.
But basically it allows for setting the language per format rather than globally.
Once merged, can update this this to allow for different locale settings.
The defaults of numeral are not useful, and there is currently no way to set
numeral.language
E.g.
The text was updated successfully, but these errors were encountered: