From beb07038329cd01ffcfd69a6f1801efb41032c81 Mon Sep 17 00:00:00 2001 From: salido-m Date: Fri, 11 Nov 2016 21:35:36 +0100 Subject: [PATCH] Add density units (#205) * Convert KilogramPer* units to GramPer* and add Kilo prefix --- UnitsNet.Tests/CustomCode/DensityTests.cs | 3 + .../GeneratedCode/DensityTestsBase.g.cs | 18 +++ UnitsNet/GeneratedCode/Enums/DensityUnit.g.cs | 3 + .../Number/NumberToDensityExtensions.g.cs | 102 +++++++++++++++ .../GeneratedCode/UnitClasses/Density.g.cs | 123 +++++++++++++++++- .../GeneratedCode/UnitSystem.Default.g.cs | 18 ++- UnitsNet/Scripts/UnitDefinitions/Density.json | 35 ++--- 7 files changed, 279 insertions(+), 23 deletions(-) diff --git a/UnitsNet.Tests/CustomCode/DensityTests.cs b/UnitsNet.Tests/CustomCode/DensityTests.cs index a2f5ec0a74..ff2722b079 100644 --- a/UnitsNet.Tests/CustomCode/DensityTests.cs +++ b/UnitsNet.Tests/CustomCode/DensityTests.cs @@ -25,6 +25,9 @@ namespace UnitsNet.Tests.CustomCode { public class DensityTests : DensityTestsBase { + protected override double GramsPerCubicCentimeterInOneKilogramPerCubicMeter => 1e-3; + protected override double GramsPerCubicMeterInOneKilogramPerCubicMeter => 1e3; + protected override double GramsPerCubicMillimeterInOneKilogramPerCubicMeter => 1e-6; protected override double KilogramsPerCubicCentimeterInOneKilogramPerCubicMeter => 1e-6; protected override double KilogramsPerCubicMeterInOneKilogramPerCubicMeter => 1; diff --git a/UnitsNet.Tests/GeneratedCode/DensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/DensityTestsBase.g.cs index fdd88348b1..85a432e897 100644 --- a/UnitsNet.Tests/GeneratedCode/DensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/DensityTestsBase.g.cs @@ -53,6 +53,9 @@ namespace UnitsNet.Tests // ReSharper disable once PartialTypeWithSinglePart public abstract partial class DensityTestsBase { + protected abstract double GramsPerCubicCentimeterInOneKilogramPerCubicMeter { get; } + protected abstract double GramsPerCubicMeterInOneKilogramPerCubicMeter { get; } + protected abstract double GramsPerCubicMillimeterInOneKilogramPerCubicMeter { get; } protected abstract double KilogramsPerCubicCentimeterInOneKilogramPerCubicMeter { get; } protected abstract double KilogramsPerCubicMeterInOneKilogramPerCubicMeter { get; } protected abstract double KilogramsPerCubicMillimeterInOneKilogramPerCubicMeter { get; } @@ -65,6 +68,9 @@ public abstract partial class DensityTestsBase protected abstract double TonnesPerCubicMillimeterInOneKilogramPerCubicMeter { get; } // ReSharper disable VirtualMemberNeverOverriden.Global + protected virtual double GramsPerCubicCentimeterTolerance { get { return 1e-5; } } + protected virtual double GramsPerCubicMeterTolerance { get { return 1e-5; } } + protected virtual double GramsPerCubicMillimeterTolerance { get { return 1e-5; } } protected virtual double KilogramsPerCubicCentimeterTolerance { get { return 1e-5; } } protected virtual double KilogramsPerCubicMeterTolerance { get { return 1e-5; } } protected virtual double KilogramsPerCubicMillimeterTolerance { get { return 1e-5; } } @@ -81,6 +87,9 @@ public abstract partial class DensityTestsBase public void KilogramPerCubicMeterToDensityUnits() { Density kilogrampercubicmeter = Density.FromKilogramsPerCubicMeter(1); + Assert.AreEqual(GramsPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerCubicCentimeter, GramsPerCubicCentimeterTolerance); + Assert.AreEqual(GramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerCubicMeter, GramsPerCubicMeterTolerance); + Assert.AreEqual(GramsPerCubicMillimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerCubicMillimeter, GramsPerCubicMillimeterTolerance); Assert.AreEqual(KilogramsPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.KilogramsPerCubicCentimeter, KilogramsPerCubicCentimeterTolerance); Assert.AreEqual(KilogramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.KilogramsPerCubicMeter, KilogramsPerCubicMeterTolerance); Assert.AreEqual(KilogramsPerCubicMillimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.KilogramsPerCubicMillimeter, KilogramsPerCubicMillimeterTolerance); @@ -96,6 +105,9 @@ public void KilogramPerCubicMeterToDensityUnits() [Test] public void FromValueAndUnit() { + Assert.AreEqual(1, Density.From(1, DensityUnit.GramPerCubicCentimeter).GramsPerCubicCentimeter, GramsPerCubicCentimeterTolerance); + Assert.AreEqual(1, Density.From(1, DensityUnit.GramPerCubicMeter).GramsPerCubicMeter, GramsPerCubicMeterTolerance); + Assert.AreEqual(1, Density.From(1, DensityUnit.GramPerCubicMillimeter).GramsPerCubicMillimeter, GramsPerCubicMillimeterTolerance); Assert.AreEqual(1, Density.From(1, DensityUnit.KilogramPerCubicCentimeter).KilogramsPerCubicCentimeter, KilogramsPerCubicCentimeterTolerance); Assert.AreEqual(1, Density.From(1, DensityUnit.KilogramPerCubicMeter).KilogramsPerCubicMeter, KilogramsPerCubicMeterTolerance); Assert.AreEqual(1, Density.From(1, DensityUnit.KilogramPerCubicMillimeter).KilogramsPerCubicMillimeter, KilogramsPerCubicMillimeterTolerance); @@ -112,6 +124,9 @@ public void FromValueAndUnit() public void As() { var kilogrampercubicmeter = Density.FromKilogramsPerCubicMeter(1); + Assert.AreEqual(GramsPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.GramPerCubicCentimeter), GramsPerCubicCentimeterTolerance); + Assert.AreEqual(GramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.GramPerCubicMeter), GramsPerCubicMeterTolerance); + Assert.AreEqual(GramsPerCubicMillimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.GramPerCubicMillimeter), GramsPerCubicMillimeterTolerance); Assert.AreEqual(KilogramsPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.KilogramPerCubicCentimeter), KilogramsPerCubicCentimeterTolerance); Assert.AreEqual(KilogramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.KilogramPerCubicMeter), KilogramsPerCubicMeterTolerance); Assert.AreEqual(KilogramsPerCubicMillimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.KilogramPerCubicMillimeter), KilogramsPerCubicMillimeterTolerance); @@ -128,6 +143,9 @@ public void As() public void ConversionRoundTrip() { Density kilogrampercubicmeter = Density.FromKilogramsPerCubicMeter(1); + Assert.AreEqual(1, Density.FromGramsPerCubicCentimeter(kilogrampercubicmeter.GramsPerCubicCentimeter).KilogramsPerCubicMeter, GramsPerCubicCentimeterTolerance); + Assert.AreEqual(1, Density.FromGramsPerCubicMeter(kilogrampercubicmeter.GramsPerCubicMeter).KilogramsPerCubicMeter, GramsPerCubicMeterTolerance); + Assert.AreEqual(1, Density.FromGramsPerCubicMillimeter(kilogrampercubicmeter.GramsPerCubicMillimeter).KilogramsPerCubicMeter, GramsPerCubicMillimeterTolerance); Assert.AreEqual(1, Density.FromKilogramsPerCubicCentimeter(kilogrampercubicmeter.KilogramsPerCubicCentimeter).KilogramsPerCubicMeter, KilogramsPerCubicCentimeterTolerance); Assert.AreEqual(1, Density.FromKilogramsPerCubicMeter(kilogrampercubicmeter.KilogramsPerCubicMeter).KilogramsPerCubicMeter, KilogramsPerCubicMeterTolerance); Assert.AreEqual(1, Density.FromKilogramsPerCubicMillimeter(kilogrampercubicmeter.KilogramsPerCubicMillimeter).KilogramsPerCubicMeter, KilogramsPerCubicMillimeterTolerance); diff --git a/UnitsNet/GeneratedCode/Enums/DensityUnit.g.cs b/UnitsNet/GeneratedCode/Enums/DensityUnit.g.cs index e8ad957ff4..bee0dfbf94 100644 --- a/UnitsNet/GeneratedCode/Enums/DensityUnit.g.cs +++ b/UnitsNet/GeneratedCode/Enums/DensityUnit.g.cs @@ -42,6 +42,9 @@ namespace UnitsNet.Units public enum DensityUnit { Undefined = 0, + GramPerCubicCentimeter, + GramPerCubicMeter, + GramPerCubicMillimeter, KilogramPerCubicCentimeter, KilogramPerCubicMeter, KilogramPerCubicMillimeter, diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToDensityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToDensityExtensions.g.cs index ac26d2ecef..cb5450be23 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToDensityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToDensityExtensions.g.cs @@ -44,6 +44,108 @@ namespace UnitsNet.Extensions.NumberToDensity { public static class NumberToDensityExtensions { + #region GramPerCubicCentimeter + + /// + public static Density GramsPerCubicCentimeter(this int value) => Density.FromGramsPerCubicCentimeter(value); + + /// + public static Density? GramsPerCubicCentimeter(this int? value) => Density.FromGramsPerCubicCentimeter(value); + + /// + public static Density GramsPerCubicCentimeter(this long value) => Density.FromGramsPerCubicCentimeter(value); + + /// + public static Density? GramsPerCubicCentimeter(this long? value) => Density.FromGramsPerCubicCentimeter(value); + + /// + public static Density GramsPerCubicCentimeter(this double value) => Density.FromGramsPerCubicCentimeter(value); + + /// + public static Density? GramsPerCubicCentimeter(this double? value) => Density.FromGramsPerCubicCentimeter(value); + + /// + public static Density GramsPerCubicCentimeter(this float value) => Density.FromGramsPerCubicCentimeter(value); + + /// + public static Density? GramsPerCubicCentimeter(this float? value) => Density.FromGramsPerCubicCentimeter(value); + + /// + public static Density GramsPerCubicCentimeter(this decimal value) => Density.FromGramsPerCubicCentimeter(Convert.ToDouble(value)); + + /// + public static Density? GramsPerCubicCentimeter(this decimal? value) => Density.FromGramsPerCubicCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); + + #endregion + + #region GramPerCubicMeter + + /// + public static Density GramsPerCubicMeter(this int value) => Density.FromGramsPerCubicMeter(value); + + /// + public static Density? GramsPerCubicMeter(this int? value) => Density.FromGramsPerCubicMeter(value); + + /// + public static Density GramsPerCubicMeter(this long value) => Density.FromGramsPerCubicMeter(value); + + /// + public static Density? GramsPerCubicMeter(this long? value) => Density.FromGramsPerCubicMeter(value); + + /// + public static Density GramsPerCubicMeter(this double value) => Density.FromGramsPerCubicMeter(value); + + /// + public static Density? GramsPerCubicMeter(this double? value) => Density.FromGramsPerCubicMeter(value); + + /// + public static Density GramsPerCubicMeter(this float value) => Density.FromGramsPerCubicMeter(value); + + /// + public static Density? GramsPerCubicMeter(this float? value) => Density.FromGramsPerCubicMeter(value); + + /// + public static Density GramsPerCubicMeter(this decimal value) => Density.FromGramsPerCubicMeter(Convert.ToDouble(value)); + + /// + public static Density? GramsPerCubicMeter(this decimal? value) => Density.FromGramsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); + + #endregion + + #region GramPerCubicMillimeter + + /// + public static Density GramsPerCubicMillimeter(this int value) => Density.FromGramsPerCubicMillimeter(value); + + /// + public static Density? GramsPerCubicMillimeter(this int? value) => Density.FromGramsPerCubicMillimeter(value); + + /// + public static Density GramsPerCubicMillimeter(this long value) => Density.FromGramsPerCubicMillimeter(value); + + /// + public static Density? GramsPerCubicMillimeter(this long? value) => Density.FromGramsPerCubicMillimeter(value); + + /// + public static Density GramsPerCubicMillimeter(this double value) => Density.FromGramsPerCubicMillimeter(value); + + /// + public static Density? GramsPerCubicMillimeter(this double? value) => Density.FromGramsPerCubicMillimeter(value); + + /// + public static Density GramsPerCubicMillimeter(this float value) => Density.FromGramsPerCubicMillimeter(value); + + /// + public static Density? GramsPerCubicMillimeter(this float? value) => Density.FromGramsPerCubicMillimeter(value); + + /// + public static Density GramsPerCubicMillimeter(this decimal value) => Density.FromGramsPerCubicMillimeter(Convert.ToDouble(value)); + + /// + public static Density? GramsPerCubicMillimeter(this decimal? value) => Density.FromGramsPerCubicMillimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); + + #endregion + #region KilogramPerCubicCentimeter /// diff --git a/UnitsNet/GeneratedCode/UnitClasses/Density.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Density.g.cs index 2fc8f45a66..32fa0de191 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Density.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Density.g.cs @@ -110,12 +110,36 @@ public static DensityUnit BaseUnit get { return DensityUnit.KilogramPerCubicMeter; } } + /// + /// Get Density in GramsPerCubicCentimeter. + /// + public double GramsPerCubicCentimeter + { + get { return _kilogramsPerCubicMeter*1e-3; } + } + + /// + /// Get Density in GramsPerCubicMeter. + /// + public double GramsPerCubicMeter + { + get { return _kilogramsPerCubicMeter*1e3; } + } + + /// + /// Get Density in GramsPerCubicMillimeter. + /// + public double GramsPerCubicMillimeter + { + get { return _kilogramsPerCubicMeter*1e-6; } + } + /// /// Get Density in KilogramsPerCubicCentimeter. /// public double KilogramsPerCubicCentimeter { - get { return _kilogramsPerCubicMeter*1e-6; } + get { return (_kilogramsPerCubicMeter*1e-3) / 1e3d; } } /// @@ -123,7 +147,7 @@ public double KilogramsPerCubicCentimeter /// public double KilogramsPerCubicMeter { - get { return _kilogramsPerCubicMeter; } + get { return (_kilogramsPerCubicMeter*1e3) / 1e3d; } } /// @@ -131,7 +155,7 @@ public double KilogramsPerCubicMeter /// public double KilogramsPerCubicMillimeter { - get { return _kilogramsPerCubicMeter*1e-9; } + get { return (_kilogramsPerCubicMeter*1e-6) / 1e3d; } } /// @@ -199,12 +223,36 @@ public static Density Zero get { return new Density(); } } + /// + /// Get Density from GramsPerCubicCentimeter. + /// + public static Density FromGramsPerCubicCentimeter(double gramspercubiccentimeter) + { + return new Density(gramspercubiccentimeter/1e-3); + } + + /// + /// Get Density from GramsPerCubicMeter. + /// + public static Density FromGramsPerCubicMeter(double gramspercubicmeter) + { + return new Density(gramspercubicmeter/1e3); + } + + /// + /// Get Density from GramsPerCubicMillimeter. + /// + public static Density FromGramsPerCubicMillimeter(double gramspercubicmillimeter) + { + return new Density(gramspercubicmillimeter/1e-6); + } + /// /// Get Density from KilogramsPerCubicCentimeter. /// public static Density FromKilogramsPerCubicCentimeter(double kilogramspercubiccentimeter) { - return new Density(kilogramspercubiccentimeter/1e-6); + return new Density((kilogramspercubiccentimeter/1e-3) * 1e3d); } /// @@ -212,7 +260,7 @@ public static Density FromKilogramsPerCubicCentimeter(double kilogramspercubicce /// public static Density FromKilogramsPerCubicMeter(double kilogramspercubicmeter) { - return new Density(kilogramspercubicmeter); + return new Density((kilogramspercubicmeter/1e3) * 1e3d); } /// @@ -220,7 +268,7 @@ public static Density FromKilogramsPerCubicMeter(double kilogramspercubicmeter) /// public static Density FromKilogramsPerCubicMillimeter(double kilogramspercubicmillimeter) { - return new Density(kilogramspercubicmillimeter/1e-9); + return new Density((kilogramspercubicmillimeter/1e-6) * 1e3d); } /// @@ -280,6 +328,51 @@ public static Density FromTonnesPerCubicMillimeter(double tonnespercubicmillimet } #if !WINDOWS_UWP + /// + /// Get nullable Density from nullable GramsPerCubicCentimeter. + /// + public static Density? FromGramsPerCubicCentimeter(double? gramspercubiccentimeter) + { + if (gramspercubiccentimeter.HasValue) + { + return FromGramsPerCubicCentimeter(gramspercubiccentimeter.Value); + } + else + { + return null; + } + } + + /// + /// Get nullable Density from nullable GramsPerCubicMeter. + /// + public static Density? FromGramsPerCubicMeter(double? gramspercubicmeter) + { + if (gramspercubicmeter.HasValue) + { + return FromGramsPerCubicMeter(gramspercubicmeter.Value); + } + else + { + return null; + } + } + + /// + /// Get nullable Density from nullable GramsPerCubicMillimeter. + /// + public static Density? FromGramsPerCubicMillimeter(double? gramspercubicmillimeter) + { + if (gramspercubicmillimeter.HasValue) + { + return FromGramsPerCubicMillimeter(gramspercubicmillimeter.Value); + } + else + { + return null; + } + } + /// /// Get nullable Density from nullable KilogramsPerCubicCentimeter. /// @@ -442,6 +535,12 @@ public static Density From(double val, DensityUnit fromUnit) { switch (fromUnit) { + case DensityUnit.GramPerCubicCentimeter: + return FromGramsPerCubicCentimeter(val); + case DensityUnit.GramPerCubicMeter: + return FromGramsPerCubicMeter(val); + case DensityUnit.GramPerCubicMillimeter: + return FromGramsPerCubicMillimeter(val); case DensityUnit.KilogramPerCubicCentimeter: return FromKilogramsPerCubicCentimeter(val); case DensityUnit.KilogramPerCubicMeter: @@ -483,6 +582,12 @@ public static Density From(double val, DensityUnit fromUnit) } switch (fromUnit) { + case DensityUnit.GramPerCubicCentimeter: + return FromGramsPerCubicCentimeter(value.Value); + case DensityUnit.GramPerCubicMeter: + return FromGramsPerCubicMeter(value.Value); + case DensityUnit.GramPerCubicMillimeter: + return FromGramsPerCubicMillimeter(value.Value); case DensityUnit.KilogramPerCubicCentimeter: return FromKilogramsPerCubicCentimeter(value.Value); case DensityUnit.KilogramPerCubicMeter: @@ -657,6 +762,12 @@ public double As(DensityUnit unit) { switch (unit) { + case DensityUnit.GramPerCubicCentimeter: + return GramsPerCubicCentimeter; + case DensityUnit.GramPerCubicMeter: + return GramsPerCubicMeter; + case DensityUnit.GramPerCubicMillimeter: + return GramsPerCubicMillimeter; case DensityUnit.KilogramPerCubicCentimeter: return KilogramsPerCubicCentimeter; case DensityUnit.KilogramPerCubicMeter: diff --git a/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs b/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs index bbbcb81306..31eb003acb 100644 --- a/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs +++ b/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs @@ -290,6 +290,22 @@ private static readonly ReadOnlyCollection DefaultLocalization new UnitLocalization(typeof (DensityUnit), new[] { + new CulturesForEnumValue((int) DensityUnit.GramPerCubicCentimeter, + new[] + { + new AbbreviationsForCulture("en-US", "g/cm³"), + }), + new CulturesForEnumValue((int) DensityUnit.GramPerCubicMeter, + new[] + { + new AbbreviationsForCulture("en-US", "g/m³"), + new AbbreviationsForCulture("ru-RU", "г/м³"), + }), + new CulturesForEnumValue((int) DensityUnit.GramPerCubicMillimeter, + new[] + { + new AbbreviationsForCulture("en-US", "g/mm³"), + }), new CulturesForEnumValue((int) DensityUnit.KilogramPerCubicCentimeter, new[] { @@ -299,7 +315,7 @@ private static readonly ReadOnlyCollection DefaultLocalization new[] { new AbbreviationsForCulture("en-US", "kg/m³"), - new AbbreviationsForCulture("ru-RU", "кг/м³"), + new AbbreviationsForCulture("ru-RU", "kг/м³"), }), new CulturesForEnumValue((int) DensityUnit.KilogramPerCubicMillimeter, new[] diff --git a/UnitsNet/Scripts/UnitDefinitions/Density.json b/UnitsNet/Scripts/UnitDefinitions/Density.json index 8fc7de9fb3..b1fa076adf 100644 --- a/UnitsNet/Scripts/UnitDefinitions/Density.json +++ b/UnitsNet/Scripts/UnitDefinitions/Density.json @@ -5,42 +5,45 @@ "XmlDocRemarks": "http://en.wikipedia.org/wiki/Density", "Units": [ { - "SingularName": "KilogramPerCubicMillimeter", - "PluralName": "KilogramsPerCubicMillimeter", - "FromUnitToBaseFunc": "x/1e-9", - "FromBaseToUnitFunc": "x*1e-9", + "SingularName": "GramPerCubicMillimeter", + "PluralName": "GramsPerCubicMillimeter", + "FromUnitToBaseFunc": "x/1e-6", + "FromBaseToUnitFunc": "x*1e-6", + "Prefixes": [ "Kilo" ], "Localization": [ { "Culture": "en-US", - "Abbreviations": [ "kg/mm³" ] + "Abbreviations": [ "g/mm³" ] } ] }, { - "SingularName": "KilogramPerCubicCentimeter", - "PluralName": "KilogramsPerCubicCentimeter", - "FromUnitToBaseFunc": "x/1e-6", - "FromBaseToUnitFunc": "x*1e-6", + "SingularName": "GramPerCubicCentimeter", + "PluralName": "GramsPerCubicCentimeter", + "FromUnitToBaseFunc": "x/1e-3", + "FromBaseToUnitFunc": "x*1e-3", + "Prefixes": [ "Kilo" ], "Localization": [ { "Culture": "en-US", - "Abbreviations": [ "kg/cm³" ] + "Abbreviations": [ "g/cm³" ] } ] }, { - "SingularName": "KilogramPerCubicMeter", - "PluralName": "KilogramsPerCubicMeter", - "FromUnitToBaseFunc": "x", - "FromBaseToUnitFunc": "x", + "SingularName": "GramPerCubicMeter", + "PluralName": "GramsPerCubicMeter", + "FromUnitToBaseFunc": "x/1e3", + "FromBaseToUnitFunc": "x*1e3", + "Prefixes": [ "Kilo" ], "Localization": [ { "Culture": "en-US", - "Abbreviations": [ "kg/m³" ] + "Abbreviations": [ "g/m³" ] }, { "Culture": "ru-RU", - "Abbreviations": [ "кг/м³" ] + "Abbreviations": [ "г/м³" ] } ] },