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

Format currency as .2f #569

Closed
AFoletti opened this issue May 24, 2022 · 4 comments
Closed

Format currency as .2f #569

AFoletti opened this issue May 24, 2022 · 4 comments
Assignees
Labels

Comments

@AFoletti
Copy link

Is your feature request related to a problem? Please describe.
When storing a number in the triple store, trailing zeroes in the decimals are truncated (ex: 10.50 becomes 10.5).
While this makes very much sense in general, there are situations where you want to show a very specific number of decimals (specifically when using currencies).
Example

Describe the solution you'd like
When displaying a currency, it would be nice to have trailing zeroes added to show cents. Example, 10.5 CHF should show as 10.50.
I would like for visualize to check if the number is a currency and display it in a .2f format

Describe alternatives you've considered
This may look like a minor change, but we truly are not used to see currencies truncated and it really looks strange in visualize. It may stay as it is without impacting functionality or correctness in any way, but it remains a nice visual improvement nevertheless.

@ptbrowne ptbrowne added the good first issue Good for newcomers label May 30, 2022
@sosiology
Copy link
Contributor

@ptbrowne
Copy link
Collaborator

ptbrowne commented Aug 8, 2022

@l00mi What would be the way to detect a currency dimension ? I searched for "currency" inside the cube.link documentation but could not see anything.

Asked the question

@l00mi
Copy link

l00mi commented Aug 14, 2022

That would be if qudt:unit uses a currency e.g. https://qudt.org/vocab/unit/SwissFranc, which has the property qudt:hasQuantityKind which is https://qudt.org/vocab/quantitykind/Currency.

@ptbrowne ptbrowne self-assigned this Aug 16, 2022
@ptbrowne
Copy link
Collaborator

Fixed in #653

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

No branches or pull requests

4 participants