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

Add a currency field formatter #25993

Closed
timroes opened this issue Nov 21, 2018 · 5 comments
Closed

Add a currency field formatter #25993

timroes opened this issue Nov 21, 2018 · 5 comments
Labels
enhancement New value added to drive a business result Feature:FieldFormatters Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort

Comments

@timroes
Copy link
Contributor

timroes commented Nov 21, 2018

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.

@timroes timroes added good first issue low hanging fruit enhancement New value added to drive a business result Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages labels Nov 21, 2018
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@jn01674361
Copy link

Hi, can I be assigned to this issue? :-)

@lukeelmers
Copy link
Member

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 i18n locales right away per #27475, or would we want to roll out an update before that PR is ready? Any additional guidance we can give to @jn01674361?

@lukeelmers lukeelmers assigned lukeelmers and unassigned lukeelmers Dec 28, 2018
@lukeelmers lukeelmers added :AppArch and removed Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Mar 27, 2019
@lukeelmers lukeelmers removed the good first issue low hanging fruit label Apr 26, 2019
@timroes
Copy link
Contributor Author

timroes commented Apr 26, 2019

@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):

  • Currency (maybe even allow a custom currency symbol)
  • Overwrite number format (we might want to have a default number format assigned for each currency, but the user should still be able to overwrite this). I think we should make this configuration way easier then using some (for non technical users) weird numeral JS string. So we might rather want to let them configure something like: thousand separator, decimal point, grouping, position of currency symbol as individual fields

@ppisljar
Copy link
Member

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.

@ppisljar ppisljar closed this as not planned Won't fix, can't repro, duplicate, stale Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:FieldFormatters Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort
Projects
None yet
6 participants