Issue with Currency format D3

See original GitHub issue

I’m trying to set up the currency format in superset charts but it is always displayed in the American format. ($ 1,234.56)

Tried the solution present in #3972 by @PeterCahn by changing the superset/assets/node_modules/d3-format/src/defaultLocale.js file to the desired one and didn’t work for the currency problem.

  decimal: ",",
  thousands: ".",
  grouping: [3],
  currency: ["R$", ""],
  dateTime: "%d/%m/%Y %H:%M:%S",
  date: "%d/%m/%Y",
  time: "%H:%M:%S",
  periods: ["AM", "PM"],
  days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"],
  shortDays: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"],
  months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
  shortMonths: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"]});

Expected results

Expected to see the currency as R$ 1.234,56

Actual results

$ 1,234.56

Screenshots

I highlighted the date because looks like the defaultLocale is working for date/time. Foto

Environment

(please complete the following information):

  • superset version: 0.34.1rc1
  • python version: Python 3.6.9
  • node.js version: v10.16.3
  • npm version: 6.9.0

Checklist

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [] I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven’t found one similar.

Additional context

I’m opening this new issue because the previus one was closed.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
rusackascommented, Apr 1, 2020

Holler if this is still an issue, and we can re-open it if needed.

2reactions
andy-clapsoncommented, Jan 16, 2020

We are having the same issue - getting this https://github.com/apache/incubator-superset/issues/3972#issuecomment-535037981 working in some way would be a dynamite upgrade for deploying across non-US countries.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with Currency format D3 #8913 - apache/superset - GitHub
I'm trying to set up the currency format in superset charts but it is always displayed in the American format. ($ 1,234.56).
Read more >
D3.JS: Format as currency euro - Stack Overflow
The dollar sign should be kept, as it means "currency". What you need to do is define the locale (cf. documentation) using d3.locale() ......
Read more >
d3.format - Observable
d3 -format helps you format numbers for human consumption. ... and the default currency mark, the euro symbol, appears after the number.
Read more >
d3.js nvd3 issue: display the dollar sign, and the currency ...
[Solved]-d3.js nvd3 issue: display the dollar sign, and the currency format in the tooltip-d3.js · 1) Make the tick format into a named...
Read more >
D3.js format() Function - GeeksforGeeks
Currency sign i.e $. console.log(d3.format( "$, " )(4200)). /* Left and right side of the number is. filled with dots and centered.*/.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found