* Turn on uom checks Signed-off-by: Nick Cameron <nrc@ncameron.org> * Convert all lengths to mm for engine calls Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
50 lines
27 KiB
Markdown
50 lines
27 KiB
Markdown
---
|
|
title: "fromYd"
|
|
excerpt: "Converts a number from yards to the current default unit."
|
|
layout: manual
|
|
---
|
|
|
|
**WARNING:** This function is deprecated.
|
|
|
|
Converts a number from yards to the current default unit.
|
|
|
|
*DEPRECATED* prefer using explicit numeric suffixes (e.g., `42yd`) or the `to...` conversion functions.
|
|
|
|
No matter what units the current file uses, this function will always return a number equivalent to the input in yards.
|
|
|
|
For example, if the current file uses inches, `fromYd(1)` will return `36`. If the current file uses millimeters, `fromYd(1)` will return `914.4`. If the current file uses yards, `fromYd(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 `fromYd(10)` is more readable that your intent is "I want 10 yards" than `10 * 914.4`, if the file settings are in millimeters.
|
|
|
|
```js
|
|
fromYd(input: number): number
|
|
```
|
|
|
|
### Tags
|
|
|
|
* `units`
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `input` | [`number`](/docs/kcl/types/number) | | Yes |
|
|
|
|
### Returns
|
|
|
|
[`number`](/docs/kcl/types/number)
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
totalWidth = fromYd(10)
|
|
```
|
|
|
|

|
|
|
|
|