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

Canvas does not use Kibana number formatting locale #28007

Closed
wick-ipedia opened this issue Jan 3, 2019 · 13 comments
Closed

Canvas does not use Kibana number formatting locale #28007

wick-ipedia opened this issue Jan 3, 2019 · 13 comments
Labels
enhancement New value added to drive a business result Feature:Canvas impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:medium Medium Level of Effort Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas

Comments

@wick-ipedia
Copy link

wick-ipedia commented Jan 3, 2019

Describe the feature:
Canvas should adhere to Kibana formatting settings. Currently Canvas number formatting is dictated by numeral.js, which defaults to a period (.) for the decimal separator and a comma (,) for the digit separator. This is not the default Kibana behavior, and can cause frustration for customers.
Describe a specific use case for the feature:
Canvas by default should adhere to the default formatting defined in Kibana which as an example would show the following: 1.234.567,89. Canvas currently shows the following by default: 1,234,567.89.

@alexfrancoeur feel free to add any thoughts and/or opinions on this request.

@wick-ipedia wick-ipedia added enhancement New value added to drive a business result Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas labels Jan 3, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas

@cqliu1
Copy link
Contributor

cqliu1 commented Jan 3, 2019

@SpeechlessWick Can you add an example of where you're seeing this number format in Canvas? A screenshot and the expression on your element would be great.

@alexfrancoeur
Copy link

Thanks for filing @SpeechlessWick!

Some additional comments here. Today, Kibana allows you to define Space specific values for formatting of dates and numbers. This will be the default styling used for visualizations, discover, etc. Ideally, all other applications would be using these settings too, Canvas included. Some examples below:

image

image

If an admin or user has taken the time to adjust these settings, I could understand the frustration when loading these numbers or dates in Canvas and seeing different formats.

As @cqliu1 suggested, would you mind sharing the expression so we can duplicate? I haven't seen that format shown by default.

@wick-ipedia
Copy link
Author

wick-ipedia commented Jan 14, 2019

In the example below Canvas shows 0.72
The desired outcome is to display 0,72 in this case.

I have tried all of the formats in the expression editor in the bottom without any success.
canvas

@alexfrancoeur
Copy link

@SpeechlessWick as per the docs Canvas (and Kibana) are using a forked version of numeral.js. I would think a format like 0,00 would work out of the box, it seems odd that it doesn't. I wonder if there is a way to define locale. Any insight here @cqliu1?

@cqliu1
Copy link
Contributor

cqliu1 commented Jan 14, 2019

Currently, there's no support for changing locales, and it doesn't seem like you can feed in a format to change the delimiter from . to ,. We could add a locale argument to the formatnumber function, but we'd be limited to these locales listed here in our fork of numeraljs: https://github.com/elastic/numeral-js/blob/kibana-fork/languages.js.

@wick-ipedia
Copy link
Author

@cqliu1 Do you believe there is a way to accomplish this for the time being?

@cqliu1
Copy link
Contributor

cqliu1 commented Jan 15, 2019

@SpeechlessWick It is not currently possible in Canvas. We would need to add locale support to our formatnumber function or to have Canvas set the locale using the Kibana advanced settings.

@cqliu1 cqliu1 added the loe:medium Medium Level of Effort label Mar 15, 2019
@nerophon
Copy link
Contributor

Another customer has hit this issue. They want to format their numbers according to a custom locale, but we don't support it yet.

@fbaligand
Copy link
Contributor

fbaligand commented May 27, 2020

@alexfrancoeur @cqliu1
Since Kibana 6.2, there is number format internationalization support through this PR: #14019
Here's the advanced setting for that:
image

So it would be great that Canvas honors this advanced setting, like Discover/Visualize/Dashboard already does.

@astridtessem
Copy link

I have the same problem.
I want to show 10000.3 as 10 000,3 in canvas
This should be possible with pattern 0,0.0 when setting format:number:defaultLocale=fr
https://www.elastic.co/guide/en/kibana/master/numeral.html

@Theone0305
Copy link

Theone0305 commented Jun 13, 2022

Me too, same problem, in Canvas it doesn't work when setting the Locale=French, show always with english number format

@nickpeihl nickpeihl added the impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. label Mar 9, 2023
@jsanz
Copy link
Member

jsanz commented Apr 6, 2023

Thank you for your contribution! We are grooming our backlog to narrow in on items that we have prioritized. If our priorities change, we can reopen.

@jsanz jsanz closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2023
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:Canvas impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:medium Medium Level of Effort Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
Development

No branches or pull requests