Skip to content
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
4 changes: 2 additions & 2 deletions Common/UnitDefinitions/Length.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"FromUnitToBaseFunc": "x",
"FromBaseToUnitFunc": "x",
"Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Kilo" ],
"Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Hecto", "Kilo" ],
"Localization": [
{
"Culture": "en-US",
Expand All @@ -23,7 +23,7 @@
{
"Culture": "ru-RU",
"Abbreviations": [ "м" ],
"AbbreviationsWithPrefixes": [ "нм", "мкм", "мм", "см", "дм", "км" ]
"AbbreviationsWithPrefixes": [ "нм", "мкм", "мм", "см", "дм", "гм", "км" ]
}
]
},
Expand Down
21 changes: 20 additions & 1 deletion Common/UnitDefinitions/Volume.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"Name": "Volume",
"BaseUnit": "CubicMeter",
"XmlDoc": "Volume is the quantity of three-dimensional space enclosed by some closed boundary, for example, the space that a substance (solid, liquid, gas, or plasma) or shape occupies or contains.[1] Volume is often quantified numerically using the SI derived unit, the cubic metre. The volume of a container is generally understood to be the capacity of the container, i. e. the amount of fluid (gas or liquid) that the container could hold, rather than the amount of space the container itself displaces.",
Expand Down Expand Up @@ -58,6 +58,25 @@
]
},
{
"SingularName": "CubicHectometer",
"PluralName": "CubicHectometers",
"BaseUnits": {
"L": "Hectometer"
},
"FromUnitToBaseFunc": "x*1e6",
"FromBaseToUnitFunc": "x/1e6",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "hm³" ]
},
{
"Culture": "ru-RU",
"Abbreviations": [ "гм³" ]
}
]
},
{
"SingularName": "CubicDecimeter",
"PluralName": "CubicDecimeters",
"FromUnitToBaseFunc": "x/1e3",
Expand Down
2 changes: 2 additions & 0 deletions UnitsNet.Tests/CustomCode/LengthTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class LengthTests : LengthTestsBase

protected override double FeetInOneMeter => 3.28084;

protected override double HectometersInOneMeter => 1E-2;

protected override double TwipsInOneMeter => 56692.913386;
protected override double UsSurveyFeetInOneMeter => 3.280833333333333;

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

protected override double CubicKilometersInOneCubicMeter => 1E-9;

protected override double CubicHectometersInOneCubicMeter => 1E-6;

protected override double CubicMetersInOneCubicMeter => 1;

protected override double CubicMilesInOneCubicMeter => 2.399127585789277e-10;
Expand Down
10 changes: 10 additions & 0 deletions UnitsNet.Tests/GeneratedCode/LengthTestsBase.g.cs

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

3 changes: 2 additions & 1 deletion UnitsNet.Tests/QuantityIFormattableTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.

using System;
using System.Globalization;
using Xunit;

namespace UnitsNet.Tests
Expand Down Expand Up @@ -61,7 +62,7 @@ public void QFormatEqualsQuantityName()
[InlineData("s6", "1.234568 ft")]
public void SFormatEqualsSignificantDigits(string sFormatString, string expected)
{
Assert.Equal(expected, length.ToString(sFormatString));
Assert.Equal(expected, length.ToString(sFormatString, NumberFormatInfo.InvariantInfo));
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion UnitsNet.Tests/QuantityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void TryParse_GivenValueAndUnit_ReturnsQuantity()
Assert.True(Quantity.TryParse(typeof(Mass), "03t", out IQuantity parsedMass));
Assert.Equal(Mass.FromTonnes(3), parsedMass);

Assert.True(Quantity.TryParse(typeof(Pressure), "3.0 Mbar", out IQuantity parsedPressure));
Assert.True(Quantity.TryParse(NumberFormatInfo.InvariantInfo, typeof(Pressure), "3.0 Mbar", out IQuantity parsedPressure));
Assert.Equal(Pressure.FromMegabars(3), parsedPressure);
}

Expand Down

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.

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.

14 changes: 14 additions & 0 deletions UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs

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

Loading