Cornerstone charts and decimal places

I now have my first project where I want to use Cornerstone Charts. My problem is that the dynamic data is in European decimal style, i.e. (1.234,12).
However, Cornerstone Charts only seems to work with the dot format (1,234.12). Is there a “hidden” option to solve this without having to go through a custom provider?

However, the display of the values in the table axis will at least show correct decimal values.

You can get around this by using the replace filter in twig. Ideally we detect this, but we might run into issues using the WordPress locale. We’ll have to investigate in the future. Have a great week.

{{ '2.000,00' | replace({'.': '', ',': '.'})}}
{{ looper.item.YOUR_FIELD | replace({'.': '', ',': '.'})}}
1 Like

Thanks @charlie, that seems to to the trick.

What is, by the way, this custom json format?

screenshot_ 2024-11-27 um 19.21.06

is this also available for twig formatting?

If you outputted a single number it would technically be valid JSON, if you were looking for a nice place to edit a larger Twig template. It’s really more for using custom chart types we don’t currently support though.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.