Skip to content

Number formatting based on localeΒ #77

@chk1

Description

@chk1

It seems that currently numbers are formatted in the US/English format with d3.format:

export var numberFormat = d3.format('0,000');

In German (and probably other languages) comma and dot are used differently, i.e. the thousand separator is the dot . and comma , is used to separate the decimal place:

EN: 1,000,000.23
DE: 1.000.000,23

d3.format has locale functions, but I have not used it myself and I am not familiar with babbage.ui's code https://github.com/d3/d3-format#formatLocale

Naive solution ideas/questions:

  • Would the line in utils.js be a good starting point for implementing this?
  • Does it need to be added to the translations in os-viewer and applied dynamically in some way? (or just use browser language defaults?)

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