Skip to content

Commit 6634b7f

Browse files
tmilnthorpangularsen
authored andcommitted
Add imperial pint (#635)
Add imperial pint
1 parent 14cfe62 commit 6634b7f

File tree

8 files changed

+56
-1
lines changed

8 files changed

+56
-1
lines changed

Common/UnitDefinitions/Volume.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,21 @@
459459
"Abbreviations": [ "ac-ft", "acre-foot", "acre-feet" ]
460460
}
461461
]
462+
},
463+
{
464+
"SingularName": "ImperialPint",
465+
"PluralName": "ImperialPints",
466+
"BaseUnits": {
467+
"L": "Decimeter"
468+
},
469+
"FromUnitToBaseFunc": "x * 5.6826125e-4",
470+
"FromBaseToUnitFunc": "x / 5.6826125e-4",
471+
"Localization": [
472+
{
473+
"Culture": "en-US",
474+
"Abbreviations": [ "pt (imp.)", "UK pt", "pt", "p" ]
475+
}
476+
]
462477
}
463478
]
464479
}

UnitsNet.Tests/CustomCode/VolumeTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ public class VolumeTests : VolumeTestsBase
9090

9191
protected override double MegalitersInOneCubicMeter => 0.001;
9292

93-
[Fact]
93+
protected override double ImperialPintsInOneCubicMeter => 1.7597539863927023e3;
94+
95+
[ Fact]
9496
public void VolumeDividedByAreaEqualsLength()
9597
{
9698
Length length = Volume.FromCubicMeters(15)/Area.FromSquareMeters(5);

UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.WindowsRuntimeComponent/GeneratedCode/UnitAbbreviationsCache.g.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/VolumeUnit.g.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/UnitAbbreviationsCache.g.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Units/VolumeUnit.g.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)