AnsweredAssumed Answered

PI Vision Custom Symbol - dataupdate passes value as a string (not as a number)

Question asked by Christof on Dec 14, 2018
Latest reply on Jan 2, 2019 by Christof

Dear everyone,

 

I started creating the first custom symbols for PIVision, using the video guide that can be found here: https://pisquare.osisoft.com/community/Learn-PI/customizing-pi-vision-with-extensibility

 

However, the second sample already gave me problems.

 

I tried to show timeseries data – which worked as intended. Then I tried to filter the data using AngularJS “ng-show”, just like in the sample:

 

1.png

 

However, as you can see in the screenshot below, this does only work if the browsers language is set to english (left).

If the browser language is different, where the decimal place is a comma and not a dot (like german for example), the filter does not work, because the dataupdate function returns the data values as a string, and not as a number.

 

So my questions are:

  1. Why is data, that is obviously a double, passed as a string, and not as a number type? (note that the value type of the attribute is set to double)
  2. How can we fix this issue? (parseFloat however does not work, because on client side I don’t know the language)

 

 

2.png

Here is my code:

 

BR

Christof Steps

Outcomes