Skip to content

Commit

Permalink
Add density unit PoundsPerCubicYard + Kilo prefix (#1334)
Browse files Browse the repository at this point in the history
This commit just adds two new density units: PoundsPerCubicYard and
KilopoundsPerCubicYard.

Co-authored-by: Andrew Harres <[email protected]>
  • Loading branch information
aharres and Andrew Harres authored Dec 6, 2023
1 parent ae7cbe6 commit 202eafa
Show file tree
Hide file tree
Showing 11 changed files with 288 additions and 94 deletions.
18 changes: 18 additions & 0 deletions Common/UnitDefinitions/Density.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,24 @@
}
]
},
{
"SingularName": "PoundPerCubicYard",
"PluralName": "PoundsPerCubicYard",
"BaseUnits": {
"L": "Yard",
"M": "Pound"
},
"FromUnitToBaseFunc": "{x} / 1.685554936",
"FromBaseToUnitFunc": "{x} * 1.685554936",
"Prefixes": [ "Kilo" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "lb/yd³" ],
"AbbreviationsForPrefixes": { "Kilo": "kip/yd³" }
}
]
},
{
"SingularName": "TonnePerCubicMillimeter",
"PluralName": "TonnesPerCubicMillimeter",
Expand Down
4 changes: 3 additions & 1 deletion Common/UnitEnumValues.g.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@
"TonnePerCubicMillimeter": 51,
"FemtogramPerDeciliter": 59,
"FemtogramPerLiter": 56,
"FemtogramPerMilliliter": 61
"FemtogramPerMilliliter": 61,
"KilopoundPerCubicYard": 64,
"PoundPerCubicYard": 58
},
"Duration": {
"Day": 1,
Expand Down
26 changes: 26 additions & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Quantities/Density.g.cs

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

2 changes: 2 additions & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Units/DensityUnit.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.

4 changes: 4 additions & 0 deletions UnitsNet.Tests/CustomCode/DensityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ public class DensityTests : DensityTestsBase

protected override double KilogramsPerCubicMillimeterInOneKilogramPerCubicMeter => 1e-9;

protected override double KilopoundsPerCubicYardInOneKilogramPerCubicMeter => 1.6855549356e-3;

protected override double KilopoundsPerCubicFootInOneKilogramPerCubicMeter => 6.242796e-5;

protected override double KilopoundsPerCubicInchInOneKilogramPerCubicMeter => 3.6127292e-8;

protected override double PoundsPerCubicYardInOneKilogramPerCubicMeter => 1.6855549356;

protected override double PoundsPerCubicFootInOneKilogramPerCubicMeter => 6.242796e-2;

protected override double PoundsPerCubicInchInOneKilogramPerCubicMeter => 3.61272923e-5;
Expand Down
Loading

0 comments on commit 202eafa

Please sign in to comment.