cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Can't round digtial value with decimal part of a properties value to integer in 3D Gauge in Studio

vkrayushkin
12-Amethyst

Can't round digtial value with decimal part of a properties value to integer in 3D Gauge in Studio

I've built Vuforia Studio App that's using ThingWorx services and my AR app demonstrates Thingworx Thing's Parameter value in Vuforia 3D Gauge .
Parameter (its value) is transported from TWx to Studio project well, but I cannot restrict very long decimal part of the parameter's value for Studio visualization in 3D Gauge. In ThingWorx it has two integer digits and 6 decimal but my Studio Gauge can show no more than 3-4 digits at all. How can I round XX.XXXXXXX value from TWx to XX.XX in Studio ? Could I roung XX.XXX from ThimgWorx to integer value (XX) for Studio project purposes?

ACCEPTED SOLUTION

Accepted Solutions

You can use a filter for that. Select the gauge widget, and in the bottom panel you should see the data binding. Click the Add Filter button, and put something like this in the filter:

return value.toFixed(2);

That should round to 2 decimal places.

View solution in original post

2 REPLIES 2

You can use a filter for that. Select the gauge widget, and in the bottom panel you should see the data binding. Click the Add Filter button, and put something like this in the filter:

return value.toFixed(2);

That should round to 2 decimal places.

Hello Clay,

 

ThanXs for explanation - it works. (see attached file with Studio Preview)

 

And according your explanation we apply yet another filter

 

return Math.round(value);

 

for rounding (float) value to  integer value in our example. An d it works too.

Thank You!

Announcements

Top Tags