Difference between revisions of "Set"
m
no edit summary
imported>JOG m |
imported>JOG m |
||
Line 32: | Line 32: | ||
set a to 9.0/5 ; will set "a" to 1.800 | set a to 9.0/5 ; will set "a" to 1.800 | ||
When your variable is an integer and you want the result to be rounded you need to add 0.5: | When your variable is an integer and you want the result to be rounded you need to use a decimal point in the division and add 0.5: | ||
short a | short a | ||
set a to 9.0/5+0.5 ; will set "a" to 2 | set a to 9/5 ; will set "a" to 1 | ||
set a to 7.0/5+0.5 ; will set "a" to 1 | set a to 9/5 + 0.5 ; will set "a" to 1 | ||
set a to 9.0/5 ; will set "a" to 1 | |||
set a to 9.0/5 + 0.5 ; will set "a" to '''2''' | |||
set a to 7.0/5 + 0.5 ; will set "a" to '''1''' | |||