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

Issue with Currency format D3 #8913

Open
SWoto opened this issue Jan 2, 2020 · 4 comments
Open

Issue with Currency format D3 #8913

SWoto opened this issue Jan 2, 2020 · 4 comments

Comments

@SWoto
Copy link

@SWoto SWoto commented Jan 2, 2020

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-label-bot

This comment has been minimized.

Copy link

@issue-label-bot issue-label-bot bot commented Jan 2, 2020

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

@SWoto SWoto changed the title Currency format D3 Issue with Currency format D3 Jan 2, 2020
@tcopple

This comment has been minimized.

Copy link

@tcopple tcopple commented Jan 3, 2020

@SWoto does it work if you set the format in the chart meta? I've overcome some of the default formatting by setting it there when I want dollarized but no cents.

image

You can get there by clicking the "edit" button on the charts/list resource.

image

@SWoto

This comment has been minimized.

Copy link
Author

@SWoto SWoto commented Jan 7, 2020

It "works" when I do it, just like when i change almost the same thing in the source code... The main problem is to change the decimal/thousands separator and the currency symbol to look like:

R$ 1.234,15
instead of
$ 1,234.15

@andy-clapson

This comment has been minimized.

Copy link
Contributor

@andy-clapson andy-clapson commented Jan 16, 2020

We are having the same issue - getting this #3972 (comment) working in some way would be a dynamite upgrade for deploying across non-US countries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.