Skip to content
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

Number formatting based on locale #77

Open
chk1 opened this issue Oct 25, 2019 · 0 comments
Open

Number formatting based on locale #77

chk1 opened this issue Oct 25, 2019 · 0 comments

Comments

@chk1
Copy link

chk1 commented Oct 25, 2019

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?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant