* add unit functions Signed-off-by: Jess Frazelle <github@jessfraz.com> * add tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * update docs Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * empty * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
		
			
				
	
	
		
			39 lines
		
	
	
		
			27 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			27 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
---
 | 
						|
title: "yd"
 | 
						|
excerpt: "Yards conversion factor for current projects units."
 | 
						|
layout: manual
 | 
						|
---
 | 
						|
 | 
						|
Yards conversion factor for current projects units.
 | 
						|
 | 
						|
No matter what units the current project uses, this function will always return the conversion factor to yards.
 | 
						|
For example, if the current project uses inches, this function will return `36`. If the current project uses millimeters, this function will return `914.4`. If the current project uses yards, 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 * yd()` is more readable that your intent is "I want 10 yards" than `10 * 914.4`, if the project settings are in millimeters.
 | 
						|
 | 
						|
```js
 | 
						|
yd() -> number
 | 
						|
```
 | 
						|
 | 
						|
### Tags
 | 
						|
 | 
						|
* `units`
 | 
						|
 | 
						|
### Examples
 | 
						|
 | 
						|
```js
 | 
						|
const totalWidth = 10 * yd()
 | 
						|
```
 | 
						|
 | 
						|

 | 
						|
 | 
						|
### Arguments
 | 
						|
 | 
						|
 | 
						|
### Returns
 | 
						|
 | 
						|
`number`
 | 
						|
 | 
						|
 | 
						|
 |