Skip to content

Commit

Permalink
Add micro, nano prefix to Energy unit Joule (#1316)
Browse files Browse the repository at this point in the history
Hello,

For the correct display of the values of our laser energy meters we are
currently missing the prefixes micro and nano for the unit joule.

It would be nice if this could be added.

Many thanks
  • Loading branch information
pliebe91 authored Sep 21, 2023
1 parent a22e333 commit 7afdd82
Show file tree
Hide file tree
Showing 11 changed files with 212 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Common/UnitDefinitions/Energy.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"FromUnitToBaseFunc": "{x}",
"FromBaseToUnitFunc": "{x}",
"Prefixes": [ "Milli", "Kilo", "Mega", "Giga", "Tera", "Peta" ],
"Prefixes": [ "Nano", "Micro", "Milli", "Kilo", "Mega", "Giga", "Tera", "Peta" ],
"Localization": [
{
"Culture": "en-US",
Expand Down
4 changes: 3 additions & 1 deletion Common/UnitEnumValues.g.json
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,9 @@
"WattDay": 35,
"WattHour": 36,
"Petajoule": 43,
"Terajoule": 37
"Terajoule": 37,
"Microjoule": 47,
"Nanojoule": 45
},
"Entropy": {
"CaloriePerKelvin": 1,
Expand Down
26 changes: 26 additions & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Quantities/Energy.g.cs

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

2 changes: 2 additions & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Units/EnergyUnit.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.

6 changes: 5 additions & 1 deletion UnitsNet.Tests/CustomCode/EnergyTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed under MIT No Attribution, see LICENSE file at the root.
// Licensed under MIT No Attribution, see LICENSE file at the root.
// Copyright 2013 Andreas Gullberg Larsen ([email protected]). Maintained at https://github.com/angularsen/UnitsNet.

using System;
Expand Down Expand Up @@ -42,6 +42,10 @@ public class EnergyTests : EnergyTestsBase

protected override double MillijoulesInOneJoule => 1000;

protected override double MicrojoulesInOneJoule => 1E6;

protected override double NanojoulesInOneJoule => 1E9;

protected override double TerawattHoursInOneJoule => 2.77777778e-16;

protected override double TerawattDaysInOneJoule => 1.157407407407410E-17;
Expand Down
Loading

0 comments on commit 7afdd82

Please sign in to comment.