Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add density unit PoundsPerCubicYard + Kilo prefix #1334

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified

0.45359237 kg ÷ ( 0.9144 yd ^ 3 ) = 1.685554935555904522820787307335

1.6855549: https://www.convert-me.com/en/convert/density/lbpyd/lbpyd-to-kgpm.html?u=kgpm&v=1


protected override double PoundsPerCubicFootInOneKilogramPerCubicMeter => 6.242796e-2;

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