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

PNG download no working when formatting value to currency BRL #1833

Closed
Ymayro opened this issue Aug 12, 2020 · 4 comments
Closed

PNG download no working when formatting value to currency BRL #1833

Ymayro opened this issue Aug 12, 2020 · 4 comments

Comments

@Ymayro
Copy link

Ymayro commented Aug 12, 2020

For whatever reason when i set my labels to return a formatted currency value like the following i am not able to download PNG and when downloading the SVG the values of the both X and Y axis are not shown.

yaxis: {
        labels: {
              formatter: function (value) {
                let formatter = new Intl.NumberFormat('pt-BR', {
                style: 'currency',
                currency: 'BRL',
              });
          return formatter.format(value) 
         }
       },
},

However if i format my values as such everything works:

yaxis: {
     labels: {
         formatter: function (value) {
               return 'R$ ' + value.toLocaleString('pt-br', {minimumFractionDigits: 2})
              }
          },
 },

Does anyone knows why this happens?

@grazielacks
Copy link

grazielacks commented Jan 14, 2021

Tive o mesmo problema.
E percebi que isto acontece apenas com a moeda brasileira. É estranho.

//return value.toLocaleString('pt-BR', { style: 'currency', currency: 'BRL', }); //não funciona return value.toLocaleString('pt', { style: 'currency', currency: 'BRL', minimumFractionDigits: 2 }); //não funciona return value.toLocaleString('en-IN', { style: 'currency', currency: 'USD', minimumFractionDigits: 2 }) //funciona return value.toLocaleString('ja-JP', { style: 'currency', currency: 'JPY', minimumFractionDigits: 2 }) //funciona

Para fazer funcionar, tive que usar da seguinte forma:
return 'R$ ' + value.toLocaleString('pt-br', {minimumFractionDigits: 2})

@Nickinthebox
Copy link

Might be linked to #1671

@petersanta
Copy link

Might be linked to #1671

I think so. :)

@github-actions
Copy link

github-actions bot commented Oct 1, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants