-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Add a currency field formatter #25993
Comments
Pinging @elastic/kibana-app |
Hi, can I be assigned to this issue? :-) |
Thanks for volunteering @jn01674361! I'm not sure where we landed on the approach for implementation though -- we should confirm we are aligned on that before you move too far forward with this. @timroes @spalger @markov00 Is the plan to implement this with |
@lukeelmers I think we should not use the configured locale (at least not more as a default). Because that's actually already what we have via the current number formatter :-) A lot of people might have different currencies in their data and/or want different formatting on it based on which field/index/etc. So I think that field formatter should allow to configure a couple of things as parameters (and thus have them individually per field where you use it):
|
Thank you for contributing to this issue, however, we are closing this issue due to inactivity as part of a backlog grooming effort. If you believe this feature/bug should still be considered, please reopen with a comment. |
After some discussion with @markov00 and @spalger we decided, that the numeraljs pattern for formatting numbers is very confusing for users (e.g. see #25371). Since you need to check the numeraljs documentation to understand, that you actually need to set
$
in the format string, no matter what currency sign you want, and then switch the numeraljs locale. Also that locale can only be switched on a global level.We decided it might be best to provide an specific Currency field formatter. That would allow to specify the currency directly and potentially a locale for the numeric formatter. That way you can use different currencies depending on each field. This field formatter should not use numeral js ideally anymore, since we are trying not to use it for newer features anymore. We can check if
Intl.NumberFormat
does the job, otherwise build an easy formatter directly.The text was updated successfully, but these errors were encountered: