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 ImperialQuart to Volume #1254

Merged
merged 1 commit into from
Jun 2, 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
14 changes: 13 additions & 1 deletion Common/UnitDefinitions/Volume.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
}
]
},
{
{
"SingularName": "CubicDecimeter",
"PluralName": "CubicDecimeters",
"FromUnitToBaseFunc": "{x} / 1e3",
Expand Down Expand Up @@ -461,6 +461,18 @@
}
]
},
{
"SingularName": "ImperialQuart",
"PluralName": "ImperialQuarts",
"FromUnitToBaseFunc": "{x} * 1.1365225e-3",
"FromBaseToUnitFunc": "{x} / 1.1365225e-3",
Copy link
Owner

Choose a reason for hiding this comment

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

Verified

The imperial quart, which is used for both liquid and dry capacity, is equal to one quarter of an imperial gallon, or exactly 1.1365225 liters.

https://en.wikipedia.org/wiki/Quart

"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "qt (imp.)" ]
}
]
},
{
"SingularName": "UsPint",
"PluralName": "UsPints",
Expand Down
3 changes: 2 additions & 1 deletion Common/UnitEnumValues.g.json
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,8 @@
"UsQuart": 50,
"UsTablespoon": 51,
"UsTeaspoon": 52,
"Nanoliter": 53
"Nanoliter": 53,
"ImperialQuart": 57
},
"VolumeConcentration": {
"CentilitersPerLiter": 1,
Expand Down
13 changes: 13 additions & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Quantities/Volume.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/VolumeUnit.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.

5 changes: 5 additions & 0 deletions UnitsNet.Tests/CustomCode/VolumeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ public class VolumeTests : VolumeTestsBase

protected override double DecalitersInOneCubicMeter => 1e2;

/// <summary>
/// https://www.legislation.gov.uk/uksi/1995/1804/made
/// </summary>
protected override double ImperialQuartsInOneCubicMeter => 879.876993196;
Copy link
Owner

Choose a reason for hiding this comment

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

Verified.

Weird, wolfram normally is very precise, but seems to round here.
https://www.wolframalpha.com/input?i=1+cubic+meter+in+imperial+quarts


[Fact]
public void VolumeDividedByAreaEqualsLength()
{
Expand Down
Loading