Skip to content

Commit e443840

Browse files
dmlewis08Debra Lewis
andauthored
Add Mass unit Dalton (atomic mass unit) (#1634)
- Extended Mass units with dalton (and KiloDalton, MegaDalton, GigaDalton). - Updated tests accordingly. Wikipedia description of dalton / unified atomic mass unit: [Dalton (unit)](https://en.wikipedia.org/wiki/Dalton_(unit)) Co-authored-by: Debra Lewis <[email protected]>
1 parent 806299c commit e443840

File tree

14 files changed

+401
-5
lines changed

14 files changed

+401
-5
lines changed

Common/UnitDefinitions/Mass.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,24 @@
271271
"Abbreviations": [ "em" ]
272272
}
273273
]
274-
}
274+
},
275+
{
276+
"SingularName": "Dalton",
277+
"PluralName": "Daltons",
278+
"BaseUnits": {
279+
"M": "Dalton"
280+
},
281+
"XmlDocSummary": "The Dalton or unified atomic mass unit (abbreviation Da or u) is a unit of mass defined as 1/12 of the mass of an unbound neutral atom of carbon-12 in its nuclear and electronic ground state and at rest.",
282+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Dalton_(unit)",
283+
"FromUnitToBaseFunc": "{x} * 1.66053906660e-27",
284+
"FromBaseToUnitFunc": "{x} / 1.66053906660e-27",
285+
"Prefixes": [ "Kilo", "Mega" , "Giga" ],
286+
"Localization": [
287+
{
288+
"Culture": "en-US",
289+
"Abbreviations": [ "Da", "u" ]
290+
}
291+
]
292+
},
275293
]
276294
}

Common/UnitEnumValues.g.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,11 @@
836836
"Stone": 24,
837837
"Tonne": 25,
838838
"Femtogram": 35,
839-
"Picogram": 29
839+
"Picogram": 29,
840+
"Dalton": 37,
841+
"Gigadalton": 33,
842+
"Kilodalton": 26,
843+
"Megadalton": 30
840844
},
841845
"MassConcentration": {
842846
"CentigramPerDeciliter": 1,

Common/UnitRelations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"AreaMomentOfInertia.MeterToTheFourth = Volume.CubicMeter * Length.Meter",
1414
"double = SpecificEnergy.JoulePerKilogram * BrakeSpecificFuelConsumption.KilogramPerJoule",
1515
"DynamicViscosity.NewtonSecondPerMeterSquared = Density.KilogramPerCubicMeter * KinematicViscosity.SquareMeterPerSecond",
16-
"ElectricCurrent.Ampere = ElectricCurrentGradient.AmperePerSecond * Duration.Second",
1716
"ElectricCharge.AmpereHour = ElectricCurrent.Ampere * Duration.Hour",
17+
"ElectricCurrent.Ampere = ElectricCurrentGradient.AmperePerSecond * Duration.Second",
1818
"ElectricPotential.Volt = ElectricCurrent.Ampere * ElectricResistance.Ohm",
1919
"Energy.Joule = ElectricPotential.Volt * ElectricCharge.Coulomb",
2020
"Energy.Joule = EnergyDensity.JoulePerCubicMeter * Volume.CubicMeter",
@@ -73,8 +73,8 @@
7373
"SpecificEnergy.JoulePerKilogram = Speed.MeterPerSecond * Speed.MeterPerSecond",
7474
"SpecificWeight.NewtonPerCubicMeter = Acceleration.MeterPerSecondSquared * Density.KilogramPerCubicMeter",
7575
"Speed.MeterPerSecond = Acceleration.MeterPerSecondSquared * Duration.Second",
76-
"TemperatureDelta.DegreeCelsius = TemperatureGradient.DegreeCelsiusPerKilometer * Length.Kilometer",
7776
"TemperatureDelta.DegreeCelsius = TemperatureChangeRate.DegreeCelsiusPerSecond * Duration.Second",
77+
"TemperatureDelta.DegreeCelsius = TemperatureGradient.DegreeCelsiusPerKilometer * Length.Kilometer",
7878
"Torque.NewtonMeter = ForcePerLength.NewtonPerMeter * Area.SquareMeter",
7979
"Torque.NewtonMeter = Length.Meter * Force.Newton",
8080
"Torque.NewtonMeter = RotationalStiffness.NewtonMeterPerRadian * Angle.Radian",

UnitsNet.NanoFramework/GeneratedCode/Quantities/Mass.g.cs

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

UnitsNet.NanoFramework/GeneratedCode/Units/MassUnit.g.cs

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

UnitsNet.NumberExtensions.CS14.Tests/GeneratedCode/NumberToMassExtensionsTest.g.cs

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

UnitsNet.NumberExtensions.CS14/GeneratedCode/NumberToMassExtensions.g.cs

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

UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToMassExtensionsTest.g.cs

Lines changed: 16 additions & 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)