Questions about units

ron_moreland
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?
Tagged:

Best Answer

Answers

  • konstantin_shiriazdanov
    konstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited January 2018
    println(length/inch~" inches") if you are sure that length variable contains the value with units of length type
  • ron_moreland
    ron_moreland Member Posts: 99 ✭✭✭
    Sometimes "Foo * inch" will convert the value to an area. Why?
  • owen_sparks
    owen_sparks Member, Developers Posts: 2,660 PRO
    Sometimes "Foo * inch" will convert the value to an area. Why?
    Presumably in this case your foo already had units, so units squared = area?

    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd