How to handle different locale in symbols?

Hi All,

Depending on the locale setting of the user accessing Coresight (meaning you have no control at all), data sent to the symbol uses the locale of the user. E.g. 123,456.789 and 123.456,789 are all valid numbers but are quite reversed when using e.g. european versus american locale.

 

Any ideas how to properly handle this in a symbol? parseFloat won't work. the Globalize.js library Globalize.js · GitHub  requires to know the locale we are working in. And about there my knowledge ends...

I won't be the first one needing to deal with this, so curious what solutions people have chosen.

Parents Reply Children
  • Hello Roger. I have the issue. But the code line that Anna mention don't change anything in my symbol, the number appear incorrectly (for example, temperature of 11,88 is display like 1188). Perhaps the problem is the action of recreate, do you know what Anna mean with that? I dont know how to recreate a symbol or shape.

    When the computer (or better the internet explorer) is setting on US, all works properly. When I use the Spanish configuration (like all my users) the new symbols with amCharts go bad.


    image.png

    image_1.png

  • I find a solution for this symbol, I don't know if is the best talking about js, but work for me (sym-amcharts-RadialGauge.js)...

    function myCustomDataUpdateFunction(data) {

    // If there is indeed new data in the update

    if(data) {

    // Update the current scope with the new data value, time, and label

    // MAG este era el original scope.value = data.Value.replace(",","");

    scope.value = data.Value.replace(",",".");

    scope.time = data.Time;

    if(data.Label) {

    scope.label = data.Label;

    }

    But i have some issues with the multiple variables am charts, the same problems, nowadays I don't find a solution. If someone have some trick thanks in advance.