41 lines
27 KiB
Markdown
41 lines
27 KiB
Markdown
---
|
|
title: "m"
|
|
excerpt: "Meters conversion factor for current projects units."
|
|
layout: manual
|
|
---
|
|
|
|
Meters conversion factor for current projects units.
|
|
|
|
No matter what units the current project uses, this function will always return the conversion factor to meters.
|
|
|
|
For example, if the current project uses inches, this function will return `39.3701`. If the current project uses millimeters, this function will return `1000`. If the current project uses meters, this function will return `1`.
|
|
|
|
**Caution**: This function is only intended to be used when you absolutely MUST have different units in your code than the project settings. Otherwise, it is a bad pattern to use this function.
|
|
|
|
We merely provide these functions for convenience and readability, as `10 * m()` is more readable that your intent is "I want 10 meters" than `10 * 1000`, if the project settings are in millimeters.
|
|
|
|
```js
|
|
m() -> number
|
|
```
|
|
|
|
### Tags
|
|
|
|
* `units`
|
|
|
|
|
|
|
|
### Returns
|
|
|
|
`number`
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
totalWidth = 10 * m()
|
|
```
|
|
|
|

|
|
|
|
|