Gives a numeric value a unit of measure.
expression In unit
- A numeric expression.
- The name of a unit of measure.
You use the operator
In when an expression must become a unit of measure, for example, an argument to a procedure with that unit.
The operator is not necessary when the expression is of a compatible unit, then it changes automatically. It is also not necessary after a simple numeric literal, where only the unit is necessary.
If you try to change a value in one unit to one that is not compatible, then the result is a compiler error.