setunit()

Selects a value based on the system's unit setting (millimeters or inches).

Syntax

setunit(mm_value, inch_value)

Parameters

Parameter Type Description
mm_value Number The value to use if the system is set to millimeters.
inch_value Number The value to use if the system is set to inches.

Return Value

Examples

setunit(100, 3.937);  // returns 100 if in mm, 3.937 if in inches
setunit(25.4, 1);  // returns 25.4 if in mm, 1 if in inches

See also

mm_to_unit
unit_to_mm

mm_to_setunit
setunit_to_mm

unit_to_setunit
setunit_to_unit

setunit