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

Expose languages collection #62

Closed
carlospombeiro opened this issue Apr 18, 2013 · 2 comments
Closed

Expose languages collection #62

carlospombeiro opened this issue Apr 18, 2013 · 2 comments

Comments

@carlospombeiro
Copy link

Hello,
numeral should expose the languages collection. This way the language definition is available.

In my case I'm removing the thousands delimiter and currency symbol from an input text and test if it's a number.

Example
var langData = numeral.languages()[numeral.language()];
var re = new RegExp('[' + langData.delimiters.thousands + langData.currency.symbol + ']', "g");
var rawValue = value.replace(re, '');
var isNumber = Number(rawValue);

Thanks

@pgayvallet
Copy link

+1 for this feature.

@adamwdraper
Copy link
Owner

numeral has a validate function to accomplish this.

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

No branches or pull requests

3 participants