Skip to content

Commit 906ae24

Browse files
authored
Added Gigameter (1e+9 meters) (#1318)
Gigameter is really useful for my case, even though it is a bit obscure, when rendering astronomical distances it seems to hit the perfect spot. While I use AU and meter during the calculations, these intermediate units really help when it comes to rendering the simulation itself. It seems to be a good fit for making sure that both short and long stellar distances can be rendered without too much trouble. I am completely fine with this getting rejected as the number of meter units this library is probably getting out of hand, but I wanted to create a PR to see if it would be a good fit for the library. I followed the contribution page and also checked out the PR for Megameters (#1208) but please let me know if I missed something.
1 parent 7afdd82 commit 906ae24

File tree

13 files changed

+212
-97
lines changed

13 files changed

+212
-97
lines changed

Common/UnitDefinitions/Length.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"FromUnitToBaseFunc": "{x}",
1616
"FromBaseToUnitFunc": "{x}",
17-
"Prefixes": [ "Femto", "Pico", "Nano", "Micro", "Milli", "Centi", "Deci", "Deca", "Hecto", "Kilo", "Mega" ],
17+
"Prefixes": [ "Femto", "Pico", "Nano", "Micro", "Milli", "Centi", "Deci", "Deca", "Hecto", "Kilo", "Mega", "Giga" ],
1818
"Localization": [
1919
{
2020
"Culture": "en-US",

Common/UnitEnumValues.g.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,8 @@
695695
"Megameter": 41,
696696
"Kilofoot": 45,
697697
"Femtometer": 48,
698-
"Picometer": 43
698+
"Picometer": 43,
699+
"Gigameter": 44
699700
},
700701
"Level": {
701702
"Decibel": 1,

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

Lines changed: 13 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/LengthUnit.g.cs

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

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

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

UnitsNet.NumberExtensions/GeneratedCode/NumberToLengthExtensions.g.cs

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

UnitsNet.Tests/CustomCode/LengthTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public class LengthTests : LengthTestsBase
8686
protected override double DataMilesInOneMeter => 0.000546807;
8787

8888
protected override double MegametersInOneMeter => 1e-6;
89+
protected override double GigametersInOneMeter => 1e-9;
8990

9091
protected override double KilofeetInOneMeter => 3.28083989501e-3;
9192

UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs

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

UnitsNet/GeneratedCode/Quantities/Length.g.cs

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

UnitsNet/GeneratedCode/Resources/Length.restext

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ DtpPoints=pt
1010
Fathoms=fathom
1111
Femtometers=fm
1212
Feet=ft,',′
13+
Gigameters=Gm
1314
Hands=h,hh
1415
Hectometers=hm
1516
Inches=in,\",″

0 commit comments

Comments
 (0)