-
Notifications
You must be signed in to change notification settings - Fork 930
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
Support for Indian and other similar number formats #19
Comments
is you look at the MS C# and Ajax formatting rules, they specify a seperator and then a group size e.g. [2, 3] and you count from the right and if you hit the end of the definition, you repeat. This could easily be added on as an additional option which would default to [3]. |
http://en.wikipedia.org/wiki/Decimal_mark#Digit_grouping It looks like China and Japan group them as in 1,0000,0000,0000. The Indian number system looks like it's the most complex. It appears as though everyone else uses either 3 or 4 digit groupings. |
Yes, I need Indian currency formatting and will need to roll my own solution... |
Any progress on this? |
+1 this. Everyone in India uses that format |
The number format specified above incorrect, and is not as simple. The actual format used is a repeating pattern of groups of 3;2;2. I.e., to write hundred trillion (100,000,000,000,000 or 10E14), you would write as 1,00,00,000,00,00,000. It would be read as one crore crore. One crore basically is 10 million and has seven zeros which are grouped together. |
any progress on this ? as kibana use numeral-js , and i have requirement where i want show data abbreviation |
@DilipVxceed I ended up creating my own package called inrformat. npm: https://www.npmjs.com/package/inrformat |
@ooooak can you tell me how can i use your package in kibana.. |
Hi, I just forked the repo and made few changes in it and published my own package. Now it supports India currency. Checkout - https://www.npmjs.com/package/numeral-v2 Doc - https://numeraljs.netlify.app/ Thanks, |
Was just talking to a friend about this and in parts of India (or maybe everywhere in India) they format numbers like so: 1,00,00,000 (separator after hundreds until the last thousand) which right now, I believe, is impossible to re-create. There are probably other languages too that format their numbers like this or even more differently.
This is probably a substantial change to how Numeral-js does things. To solve, I assume Numeral-js would need to allow functions instead of objects for the "separator" property of a language which would then allow people to write their own custom formatters. The other possibility is allowing them to specify a custom format like so: '00,00,00,00,00,00,000.00' or something, but that seems kind of unwieldy since you have to make it arbitrarily big to make sure it always works.
The text was updated successfully, but these errors were encountered: