Setting the stepper to give integers instead of doubles


#1

Hi,

is there a way to make the stepper output integers instead of doubles, or a good way of converting the output to an integer?

Thanks!


#2

Converting a stepper’s value property from Double to Int… not so easy.
BUT
Converting a Double to an Int in general… I’ve got you covered.
We handle DataType conversions internally.

Let’s use a Page Variable to make the conversion.

1) Create A Page Variable of type Int

2) In the Value Changed event of the stepper, set the Page Variable (Int) to the Stepper Value (Double)
Since the Page Value is of type int, the conversion will take place and it will nip off the decimal

3) Set the label’s tet (String) to the value of the Page Variable (Int)
Notice here that another conversion is actually taking place too. From Int to String


#3

Excellent! Sometimes the obvious is staring right at you. Thanks Wade!