let>rightX=123
let>leftX=23
Let>length={Round(%rightX%-%leftX%)}
Let>size=%length%/10
message>%size%
I would expect this to return a message stating simply "10"
is this an incorrect way of using the round function?
Of course rounding isn't necessary in the expression above, however, in my expression for my script there may or may not be instances where rounding will be necessary. I am trying to write a script that will allow for both rounding with necessary and when unnecessary.
I am using version 7.4.008
Round function not working
Moderators: Dorian (MJT support), JRL
I think you're using round on the wrong result and with the numbers you posted there would be nothing to round since it would all be whole numbers.
try this instead:
let>rightX=123
let>leftX=21
Let>length=%rightX%-%leftX%
//length=102
Let>size={round(%length%/10)}
//102/10=10.2 size should be rounded to 10
message>%size%
try this instead:
let>rightX=123
let>leftX=21
Let>length=%rightX%-%leftX%
//length=102
Let>size={round(%length%/10)}
//102/10=10.2 size should be rounded to 10
message>%size%