Numbers are always formatted using a decimal point. For example: 93.2% and 9.9 dagen. The language selected by the user must be used to determine the correct decimal separator.

Comments

nhwebworker’s picture

Assigned: Unassigned » nhwebworker
Category: bug » feature

There will be an upcoming 2.x release that will improve translation issues.

j.stuyts’s picture

Thanks, I am glad I can stop working on it. I wanted to create a patch, but with PHP <5.3 it is ridiculous how hard it is to format a number given the language code from Drupal:

  • You have to know the full locale name (e.g. nl_NL). Supplying just the language code to setlocale(...) won't work. This means you have to convert the language code of Drupal to a locale name.
  • The function setlocale(...) exhibits platform-specific behavior, so the locale name you have to pass in differs per platform.
  • You have to modify global state, which can lead to subtle localization errors in multi-threaded environments.

The class NumberFormatter in PHP 5.3 fixes all these issues.