running-elephant / datart

Datart is a next generation Data Visualization Open Platform
https://running-elephant.github.io/datart-docs/
Apache License 2.0
1.99k stars 591 forks source link

Question: Currency symbols display #1328

Closed clementchong closed 2 years ago

clementchong commented 2 years ago

In Viz data format, we can set a number to use currency display format and also pick a currency. For example, CNY would use the ¥ symbol. I see that the currency has dependencies from @dinero.js

While trying to add few currencies, the build was successful but they typically uses the ISO currency code as symbol. For example, peso is display as PHP1000 instead of ₱1000. Should this question go to dinero community or we actually have some wrapper in datart?

Samples of world currency symbols at https://www.xe.com/symbols.php

Cuiyansong commented 2 years ago

Sorry, so long time response. For now, datart is only depend on @dinero.js/currencies, we removed the core dinero which we think we don't need it for current requirements.

clementchong commented 2 years ago

Does it mean the currency symbol display is dependent on @dinero.js/currencies and whether is fetched would be displayed? If I want to show ₱1000 instead of PHP1000, I need to check with @dinero community how to overwrite?

Cuiyansong commented 2 years ago

You cannot customize symbol for now, the @dinero.js/currencies is only currency & region mapping. Have you try to use Value type to instead of Currency format which could set prefix and suffix?

Like: customize-number-format

clementchong commented 2 years ago

Good idea! this would work.