Return a value as an integer


#1

Hi there

I’ve created some sliders to use in my project, but was just wondering if there’s a way of returning an integer to display on the screen? I’ve got the maths working to calculate the position of the slider correctly, but want to show this as a percentage, and at the moment this returns a number to 15 decimal places.

Example is here - first one shows the position, second one shows the percentage.

https://x91j2e.axshare.com/

Thanks loads

Niki


#2

To anyone else who needs this, the answer is to use .toFixed() at the end of your calculation
i.e. [[(Slider_1 /30).toFixed(0)]] with (0) being the number of decimal places you would like.


unlisted #3

closed #4