-
Notifications
You must be signed in to change notification settings - Fork 926
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
German number representation is incorrect #139
Comments
It seems that the bug is because the de language "delimiters" are setup as: The thousands part should be a "." and not a " " from what i understand. Any thoughts? |
Yes, the thousands delimiter should be a '.', not a ' '. |
Actually, no, the space is not incorrect. You can use both in German typograhpy. |
OK, I agree. The DIN 1333 standard does specify both. I was actually surprised that it favours the space over the dot thousands delimiter. I personally feel that I rarely see a number separated by spaces. It does allow the dot for currency formatting. There's a separate technical issue with the space-delimiter -- it frequently causes line breaks in long numbers, which should not happen either.
While I still prefer the dot as a thousands delimiter over a space, I do see a valid point in sticking with the space-delimiter. In this case it might make sense to switch to the narrow no-break space character though to prevent line breaks. |
The breaking issue is real. Moreover, narrow spaces are not necessarily any narrower in the actual rendering. The dot is, in fact, often a better-looking choice. Ideally, this would be configurable. |
As far as I can tell, the options regarding the thousands-delimiter in the German language implementation are as follows:
In general, Option 1.b is probably better than the current implementation of 1.a, due to line-breaks. |
Is there a possibility to overwrite the default delimitier? I dont want to modifiy the language file, because if I update the library via bower the modifications are gone. |
@crebuh You could override the delimeter with jQuery numeral.language('de', $.extend(numeralDE, { delimiters: {thousands: '.', decimal: ','} })); |
Couldn't we just add a |
Anyone that may be still struggling with it, I managed to make it work as follows:
And then I call my function like
|
Hi,
I am considering using Numeral.js and it's language extensions in my project. I noticed that the German number representation is incorrect.
For example: A number "12345678.91" when formatted using DE language pack, is incorrectly formatted as "12 345 678,91", whereas it should ideally be "12.345.678,91" per http://userguide.icu-project.org/formatparse
Am i missing something here?
Here's my sample code -
require(['lib/numeral/min/numeral.min/numeral', 'lib/numeral/languages/de' ], function (numeral, language) {
numeral.language('de', language);
var number = numeral(12345678.91);
console.log("DE:" + number.format('0,0.00'));
});
Thanks for creating Numeral.js and it's associated language packs!
The text was updated successfully, but these errors were encountered: