Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numeral is neither exposed nor setting numeral.language is allowed #12

Open
andrewkolesnikov opened this issue Jan 26, 2016 · 3 comments

Comments

@andrewkolesnikov
Copy link

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} ...
@andrewkolesnikov 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 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
@dwendo
Copy link
Collaborator

dwendo commented Jan 28, 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.

@dwendo
Copy link
Collaborator

dwendo commented Feb 1, 2016

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.

@hongymagic
Copy link
Owner

This is on the TODO list, and seems like @dwendo is on it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants