I'm trying to store a random number between 1 and 5 in a decimal variable (1.234, 4.567, etc). Unfortunately this code only seems to return integer values:
Set decimal [~~MyDecimal] value as random from 1 to 5
Write [Blue] 'Random Decimal = {DEC:~~MyDecimal}' to log
The output looks like this:
I've also tried:
Set decimal [~~MyDecimal] value as random from 1.1 to 5.1
Write [Blue] 'Random Decimal = {DEC:~~MyDecimal}' to log
...which now appears to be decimal numbers but inherently the range is not what I want (since I'm after 1 to 5 not 1.1 to 5.1).
THIS does work:
Set decimal [~~MyDecimal] value to the converted value of {RANDOMDEC:1.000:5.000}
Write [Blue] 'Random Decimal = {DEC:~~MyDecimal}' to log
...and it looks like it will produce the correct range as well as the number of decimal places I'm after.
I don't understand why the first example above doesn't produce random
decimals between 1 and 5, and changing the decimal place rounding on the "Set a Decimal Value" interface has no other effects. Any thoughts?