Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I found this when reviewing xmlsitemap module that could make use of this function. The discussion is in #470778: Constant floating numbers shown in the user interface must be translatable. The core API documentation at http://api.drupal.org/api/group/format/6 tells us there are functions to format numbers, strings, dates, etc., but this is partly wrong. There is currently no function that formats numbers with international rules.
In German and many other countries in the EU floating point numbers do not have a dot (0.3
). They use a comma (0,3
). We should implement this for i18n.
Comments
Comment #1
hass CreditAttribution: hass commentedComment #2
hass CreditAttribution: hass commentedComment #3
Dave ReidMy best guess is we'll need to add something similar to locale_get_plural (used in format_plural).
Comment #4
Dave ReidAlso see http://drupal.org/project/format_number
Comment #5
sun.core CreditAttribution: sun.core commentedComment #6
markus_petrux CreditAttribution: markus_petrux commentedIsn't this issue a dup of #52153: Add Number::format with settings to configure decimal point and thousands separators ?
Comment #7
Dave ReidYes this is.