kcl

fromM

Converts a number from meters to the current default unit.

No matter what units the current file uses, this function will always return a number equivalent to the input in meters.

For example, if the current file uses inches, fromM(1) will return 39.3701. If the current file uses millimeters, fromM(1) will return 1000. If the current file uses meters, fromM(1) will return 1.

Caution: This function is only intended to be used when you absolutely MUST have different units in your code than the file settings. Otherwise, it is a bad pattern to use this function.

We merely provide these functions for convenience and readability, as fromM(10) is more readable that your intent is "I want 10 meters" than 10 * 1000, if the file settings are in millimeters.

fromM(input: number): number

Tags

  • units

Arguments

NameTypeDescriptionRequired
inputnumberYes

Returns

number

Examples

totalWidth = 10 * fromM(10)

Rendered example of fromM 0