Go to: Synopsis. Flags. Return value. MEL examples.
convertUnit [-fromUnit] [-toUnit]
string
convertUnit is undoable, queryable, and editable.
This command converts values between different units of measure. The command takes a string, because a string can incorporate unit names as well as values (see examples).| Long name (short name) | [argument types] | Properties | ||
|---|---|---|---|---|
-fromUnit(-f)
|
|
|
||
|
||||
-toUnit(-t)
|
|
|
||
|
||||
// Returns string "4.80315in", which is 12.2cm in inches. convertUnit -fromUnit "cm" -toUnit "in" "12.2"; // Returns string "3.499563yd", which is 3.2m in yards. convertUnit -toUnit "yard" "3.2m"; // Returns float value 13.716, which is 5.4 inches in cm (default system units). convertUnit -fromUnit "inch" "5.4";