question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Currency in euros

See original GitHub issue

Is your feature request related to a problem? Please describe. I can’t find a clean way to display currency in euros (€) in my Nivo Charts.

Describe the solution you’d like A way to set the d3.locale functin for the chart, maybe through a property. Something like:

<Chart 
  {...props}
  locale={{
    currency: ["", "€"],
    decimal: ".",
    ...
  }}
/>

Describe alternatives you’ve considered Writing a custom function to to that, but I wouldn’t know where to put it.

Additional context I’m using the format valueFormat=">-$.4~s", which is fine, I just need the symbol instead of $

Thanks a lot

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
V-Mann-Nickcommented, Apr 25, 2022

I would like to see a feature like this implemented. Actually for me there’s no way around having some way to configure the locale for d3-format.

Our use case

We’re using nivo on the front-end, but we’re generating pdf-documents on the back-end. To render charts I use Nivo charts with server-side rendering. The properties for the nivo charts are passed over the network/JSON. This makes it impossible to use a format function.

For our purpose we need numbers formatted for German speakers. As I haven’t found a way to configure the locale for d3-format used by nivo as it’s described in the docs of d3-format we’re currently at an impasse.

What have I tried

I suspected I should be able to install d3-format@^1.4.4 and use d3.formatDefaultLocale, but for reasons I haven’t investigated this doesn’t work.

Implementation

Personally I like the api-proposal of @francescocretti to add a property for localization although I would call it d3Locale to be more precise.

I would offer myself to implement this

But I would like to first have the way this should be implemented first agreed upon with @plouc.

0reactions
stale[bot]commented, Oct 9, 2022

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Euro - Wikipedia
The euro (symbol: €; code: EUR) is the official currency of 19 out of the 27 member states of the European Union (EU)....
Read more >
The euro - European Central Bank
Today, the euro is the currency of 19 EU countries and over 340 million Europeans. It is one of the most important currencies...
Read more >
1 USD to EUR - US Dollars to Euros Exchange Rate - Xe
Our currency rankings show that the most popular Euro exchange rate is the EUR to USD rate. The currency code for Euros is...
Read more >
Euro | Definition, History, Symbol, & Facts - Britannica
euro, monetary unit and currency of the European Union (EU). It was introduced as a noncash monetary unit in 1999, and currency notes...
Read more >
Currency Exchange Table (Euro - EUR) - X-Rates
Euro△ 1.00 EUR△▽ inv. 1.00 EUR△▽ Argentine Peso 185.513944 0.005390 Australian Dollar 1.585423 0.630746 Bahraini Dinar 0.399430 2.503567
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