Skip to content

Default formatting of numerical legend values is not standard #11

@mthh

Description

@mthh

The default formatting of numerical values in the legend is not standard (for example it respects neither the FR nor the US rule for number formatting, but is a mixture of both). For example, the value 12345.67 is currently formatted as 12 345.67 by default.

I know there are values_thousands and values_decimal parameters to choose the thousand separator and the decimal separator, but I think it might be a good thing either to use defaults that match an existing formatting rule, or to be able to control the locale with which the numbers are formatted (optionally it could be possible to say that the map should use the locale of the users displaying it, so that the numbers are always displayed in a way that is correct for them).

Number.prototype.toLocaleString() allows you to format with the current locale or with a given locale (but maybe d3.formatLocale, that you are already using, can do the same thing).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions