Questions about units
ron_moreland
Member Posts: 99 ✭✭✭
I've more or less finished my first real feature script. Thanks for all the help! I had excellent help from the forum. I have questions about values with units.
I think everything in the database has meters as the length unit. Other units are assigned as conversions from meters. When I print values via "debug()", the values are in meters. Can I convert them at print time to inches?
How do you change numbers to values with units and back?
I think everything in the database has meters as the length unit. Other units are assigned as conversions from meters. When I print values via "debug()", the values are in meters. Can I convert them at print time to inches?
How do you change numbers to values with units and back?
Tagged:
0
Best Answer
-
Just multiply it by the units. e.g. Foo * inch
if it is a complex debug message with lots of outputs then this probably won’t work.Senior Director, Technical Services, EMEA5
Answers
-
println(length/inch~" inches") if you are sure that length variable contains the value with units of length type
0 -
Just multiply it by the units. e.g. Foo * inch
if it is a complex debug message with lots of outputs then this probably won’t work.Senior Director, Technical Services, EMEA5 -
Sometimes "Foo * inch" will convert the value to an area. Why?0
-
Presumably in this case your foo already had units, so units squared = area?ron_moreland said:Sometimes "Foo * inch" will convert the value to an area. Why?
Owen S.
Business Systems and Configuration Controller
HWM-Water Ltd0



