From c47a34417c6533261a25bec765b2a5faf1a17555 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Thu, 7 Dec 2023 08:44:50 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9Afixup!=20edf08b9=20-=20Improve=20pr?= =?UTF-8?q?ecision=20of=20PR=201334=20(#1335)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Weird, third time I could not get this right. All tests green locally now. --- Common/UnitDefinitions/Density.json | 4 ++-- .../GeneratedCode/Quantities/Density.g.cs | 8 ++++---- UnitsNet/GeneratedCode/Quantities/Density.g.cs | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Common/UnitDefinitions/Density.json b/Common/UnitDefinitions/Density.json index 4e42a4c800..997c3c05a5 100644 --- a/Common/UnitDefinitions/Density.json +++ b/Common/UnitDefinitions/Density.json @@ -107,8 +107,8 @@ "L": "Yard", "M": "Pound" }, - "FromUnitToBaseFunc": "{x} / (0.45359237 / 0.9144 / 0.9144 / 0.9144)", - "FromBaseToUnitFunc": "{x} * (0.45359237 / 0.9144 / 0.9144 / 0.9144)", + "FromUnitToBaseFunc": "{x} * (0.45359237 / 0.9144 / 0.9144 / 0.9144)", + "FromBaseToUnitFunc": "{x} / (0.45359237 / 0.9144 / 0.9144 / 0.9144)", "Prefixes": [ "Kilo" ], "Localization": [ { diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Density.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Density.g.cs index 04c200e089..55431e6bab 100644 --- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Density.g.cs @@ -765,7 +765,7 @@ private double GetValueInBaseUnit() DensityUnit.KilogramPerLiter => _value * 1e3, DensityUnit.KilopoundPerCubicFoot => (_value / 0.062427961) * 1e3d, DensityUnit.KilopoundPerCubicInch => (_value / 3.6127298147753e-5) * 1e3d, - DensityUnit.KilopoundPerCubicYard => (_value / (0.45359237 / 0.9144 / 0.9144 / 0.9144)) * 1e3d, + DensityUnit.KilopoundPerCubicYard => (_value * (0.45359237 / 0.9144 / 0.9144 / 0.9144)) * 1e3d, DensityUnit.MicrogramPerCubicMeter => (_value / 1e3) * 1e-6d, DensityUnit.MicrogramPerDeciliter => (_value / 1e-1) * 1e-6d, DensityUnit.MicrogramPerLiter => (_value / 1) * 1e-6d, @@ -785,7 +785,7 @@ private double GetValueInBaseUnit() DensityUnit.PoundPerCubicInch => _value / 3.6127298147753e-5, DensityUnit.PoundPerCubicMeter => _value / 2.204622621848775, DensityUnit.PoundPerCubicMillimeter => _value / 2.204622621848775e-9, - DensityUnit.PoundPerCubicYard => _value / (0.45359237 / 0.9144 / 0.9144 / 0.9144), + DensityUnit.PoundPerCubicYard => _value * (0.45359237 / 0.9144 / 0.9144 / 0.9144), DensityUnit.PoundPerImperialGallon => _value * 9.9776398e1, DensityUnit.PoundPerUSGallon => _value * 1.19826427e2, DensityUnit.SlugPerCubicCentimeter => _value * 14593903, @@ -834,7 +834,7 @@ private double GetValueAs(DensityUnit unit) DensityUnit.KilogramPerLiter => baseUnitValue / 1e3, DensityUnit.KilopoundPerCubicFoot => (baseUnitValue * 0.062427961) / 1e3d, DensityUnit.KilopoundPerCubicInch => (baseUnitValue * 3.6127298147753e-5) / 1e3d, - DensityUnit.KilopoundPerCubicYard => (baseUnitValue * (0.45359237 / 0.9144 / 0.9144 / 0.9144)) / 1e3d, + DensityUnit.KilopoundPerCubicYard => (baseUnitValue / (0.45359237 / 0.9144 / 0.9144 / 0.9144)) / 1e3d, DensityUnit.MicrogramPerCubicMeter => (baseUnitValue * 1e3) / 1e-6d, DensityUnit.MicrogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-6d, DensityUnit.MicrogramPerLiter => (baseUnitValue * 1) / 1e-6d, @@ -854,7 +854,7 @@ private double GetValueAs(DensityUnit unit) DensityUnit.PoundPerCubicInch => baseUnitValue * 3.6127298147753e-5, DensityUnit.PoundPerCubicMeter => baseUnitValue * 2.204622621848775, DensityUnit.PoundPerCubicMillimeter => baseUnitValue * 2.204622621848775e-9, - DensityUnit.PoundPerCubicYard => baseUnitValue * (0.45359237 / 0.9144 / 0.9144 / 0.9144), + DensityUnit.PoundPerCubicYard => baseUnitValue / (0.45359237 / 0.9144 / 0.9144 / 0.9144), DensityUnit.PoundPerImperialGallon => baseUnitValue / 9.9776398e1, DensityUnit.PoundPerUSGallon => baseUnitValue / 1.19826427e2, DensityUnit.SlugPerCubicCentimeter => baseUnitValue / 14593903, diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index 5f3928b24c..d648a03d8f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -1735,7 +1735,7 @@ private bool TryToUnit(DensityUnit unit, [NotNullWhen(true)] out Density? conver (DensityUnit.KilogramPerLiter, DensityUnit.KilogramPerCubicMeter) => new Density(_value * 1e3, DensityUnit.KilogramPerCubicMeter), (DensityUnit.KilopoundPerCubicFoot, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 0.062427961) * 1e3d, DensityUnit.KilogramPerCubicMeter), (DensityUnit.KilopoundPerCubicInch, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 3.6127298147753e-5) * 1e3d, DensityUnit.KilogramPerCubicMeter), - (DensityUnit.KilopoundPerCubicYard, DensityUnit.KilogramPerCubicMeter) => new Density((_value / (0.45359237 / 0.9144 / 0.9144 / 0.9144)) * 1e3d, DensityUnit.KilogramPerCubicMeter), + (DensityUnit.KilopoundPerCubicYard, DensityUnit.KilogramPerCubicMeter) => new Density((_value * (0.45359237 / 0.9144 / 0.9144 / 0.9144)) * 1e3d, DensityUnit.KilogramPerCubicMeter), (DensityUnit.MicrogramPerCubicMeter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1e3) * 1e-6d, DensityUnit.KilogramPerCubicMeter), (DensityUnit.MicrogramPerDeciliter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1e-1) * 1e-6d, DensityUnit.KilogramPerCubicMeter), (DensityUnit.MicrogramPerLiter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1) * 1e-6d, DensityUnit.KilogramPerCubicMeter), @@ -1755,7 +1755,7 @@ private bool TryToUnit(DensityUnit unit, [NotNullWhen(true)] out Density? conver (DensityUnit.PoundPerCubicInch, DensityUnit.KilogramPerCubicMeter) => new Density(_value / 3.6127298147753e-5, DensityUnit.KilogramPerCubicMeter), (DensityUnit.PoundPerCubicMeter, DensityUnit.KilogramPerCubicMeter) => new Density(_value / 2.204622621848775, DensityUnit.KilogramPerCubicMeter), (DensityUnit.PoundPerCubicMillimeter, DensityUnit.KilogramPerCubicMeter) => new Density(_value / 2.204622621848775e-9, DensityUnit.KilogramPerCubicMeter), - (DensityUnit.PoundPerCubicYard, DensityUnit.KilogramPerCubicMeter) => new Density(_value / (0.45359237 / 0.9144 / 0.9144 / 0.9144), DensityUnit.KilogramPerCubicMeter), + (DensityUnit.PoundPerCubicYard, DensityUnit.KilogramPerCubicMeter) => new Density(_value * (0.45359237 / 0.9144 / 0.9144 / 0.9144), DensityUnit.KilogramPerCubicMeter), (DensityUnit.PoundPerImperialGallon, DensityUnit.KilogramPerCubicMeter) => new Density(_value * 9.9776398e1, DensityUnit.KilogramPerCubicMeter), (DensityUnit.PoundPerUSGallon, DensityUnit.KilogramPerCubicMeter) => new Density(_value * 1.19826427e2, DensityUnit.KilogramPerCubicMeter), (DensityUnit.SlugPerCubicCentimeter, DensityUnit.KilogramPerCubicMeter) => new Density(_value * 14593903, DensityUnit.KilogramPerCubicMeter), @@ -1792,7 +1792,7 @@ private bool TryToUnit(DensityUnit unit, [NotNullWhen(true)] out Density? conver (DensityUnit.KilogramPerCubicMeter, DensityUnit.KilogramPerLiter) => new Density(_value / 1e3, DensityUnit.KilogramPerLiter), (DensityUnit.KilogramPerCubicMeter, DensityUnit.KilopoundPerCubicFoot) => new Density((_value * 0.062427961) / 1e3d, DensityUnit.KilopoundPerCubicFoot), (DensityUnit.KilogramPerCubicMeter, DensityUnit.KilopoundPerCubicInch) => new Density((_value * 3.6127298147753e-5) / 1e3d, DensityUnit.KilopoundPerCubicInch), - (DensityUnit.KilogramPerCubicMeter, DensityUnit.KilopoundPerCubicYard) => new Density((_value * (0.45359237 / 0.9144 / 0.9144 / 0.9144)) / 1e3d, DensityUnit.KilopoundPerCubicYard), + (DensityUnit.KilogramPerCubicMeter, DensityUnit.KilopoundPerCubicYard) => new Density((_value / (0.45359237 / 0.9144 / 0.9144 / 0.9144)) / 1e3d, DensityUnit.KilopoundPerCubicYard), (DensityUnit.KilogramPerCubicMeter, DensityUnit.MicrogramPerCubicMeter) => new Density((_value * 1e3) / 1e-6d, DensityUnit.MicrogramPerCubicMeter), (DensityUnit.KilogramPerCubicMeter, DensityUnit.MicrogramPerDeciliter) => new Density((_value * 1e-1) / 1e-6d, DensityUnit.MicrogramPerDeciliter), (DensityUnit.KilogramPerCubicMeter, DensityUnit.MicrogramPerLiter) => new Density((_value * 1) / 1e-6d, DensityUnit.MicrogramPerLiter), @@ -1812,7 +1812,7 @@ private bool TryToUnit(DensityUnit unit, [NotNullWhen(true)] out Density? conver (DensityUnit.KilogramPerCubicMeter, DensityUnit.PoundPerCubicInch) => new Density(_value * 3.6127298147753e-5, DensityUnit.PoundPerCubicInch), (DensityUnit.KilogramPerCubicMeter, DensityUnit.PoundPerCubicMeter) => new Density(_value * 2.204622621848775, DensityUnit.PoundPerCubicMeter), (DensityUnit.KilogramPerCubicMeter, DensityUnit.PoundPerCubicMillimeter) => new Density(_value * 2.204622621848775e-9, DensityUnit.PoundPerCubicMillimeter), - (DensityUnit.KilogramPerCubicMeter, DensityUnit.PoundPerCubicYard) => new Density(_value * (0.45359237 / 0.9144 / 0.9144 / 0.9144), DensityUnit.PoundPerCubicYard), + (DensityUnit.KilogramPerCubicMeter, DensityUnit.PoundPerCubicYard) => new Density(_value / (0.45359237 / 0.9144 / 0.9144 / 0.9144), DensityUnit.PoundPerCubicYard), (DensityUnit.KilogramPerCubicMeter, DensityUnit.PoundPerImperialGallon) => new Density(_value / 9.9776398e1, DensityUnit.PoundPerImperialGallon), (DensityUnit.KilogramPerCubicMeter, DensityUnit.PoundPerUSGallon) => new Density(_value / 1.19826427e2, DensityUnit.PoundPerUSGallon), (DensityUnit.KilogramPerCubicMeter, DensityUnit.SlugPerCubicCentimeter) => new Density(_value / 14593903, DensityUnit.SlugPerCubicCentimeter),