Skip to content

Commit

Permalink
Add Kilo prefix to yards (#1339)
Browse files Browse the repository at this point in the history
Add a "kilo" prefix to yards (similar to kilofeet). 1kyd = 1000yd.

See the bottom paragraph of [this Wikipedia article](https://en.wikipedia.org/wiki/Metrication_in_the_United_States#Hybrid_units) for an example of where this is practically used.
  • Loading branch information
jmnauman authored Dec 19, 2023
1 parent 67e16c6 commit b992708
Show file tree
Hide file tree
Showing 13 changed files with 203 additions and 64 deletions.
1 change: 1 addition & 0 deletions Common/UnitDefinitions/Length.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
},
"FromUnitToBaseFunc": "{x} * 0.9144",
"FromBaseToUnitFunc": "{x} / 0.9144",
"Prefixes": [ "Kilo" ],
"XmlDocSummary": "The yard (symbol: yd) is an English unit of length in both the British imperial and US customary systems of measurement equalling 3 feet (or 36 inches). Since 1959 the yard has been by international agreement standardized as exactly 0.9144 meter. A distance of 1,760 yards is equal to 1 mile.",
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Yard",
"Localization": [
Expand Down
3 changes: 2 additions & 1 deletion Common/UnitEnumValues.g.json
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,8 @@
"Kilofoot": 45,
"Femtometer": 48,
"Picometer": 43,
"Gigameter": 44
"Gigameter": 44,
"Kiloyard": 38
},
"Level": {
"Decibel": 1,
Expand Down
13 changes: 13 additions & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Quantities/Length.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Units/LengthUnit.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions UnitsNet.Tests/CustomCode/LengthTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public class LengthTests : LengthTestsBase

protected override double KiloparsecsInOneMeter => 3.2407790389471100000000000E-20;

protected override double KiloyardsInOneMeter => 1.0936132983E-3;

protected override double LightYearsInOneMeter => 1.0570008340247000000000000E-16;

protected override double MegalightYearsInOneMeter => 1.0570008340247000000000000E-22;
Expand Down
Loading

0 comments on commit b992708

Please sign in to comment.