Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Common/UnitDefinitions/Force.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,24 @@
}
]
},
{
"SingularName": "GramForce",
"PluralName": "GramsForce",
"FromUnitToBaseFunc": "{x} * 9.80665e-3",
"FromBaseToUnitFunc": "{x} / 9.80665e-3",
"XmlDocSummary": "The gram-force is a unit of force equal to the magnitude of force exerted by a gram of mass in standard gravity (9.80665 m/s²). It is equal to 9.80665 × 10⁻³ N.",
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Kilogram-force",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "gf" ]
},
{
"Culture": "ru-RU",
"Abbreviations": [ "гс" ]
}
]
},
{
"SingularName": "KilogramForce",
"PluralName": "KilogramsForce",
Expand Down
3 changes: 2 additions & 1 deletion Common/UnitEnumValues.g.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@
"Poundal": 12,
"PoundForce": 13,
"ShortTonForce": 14,
"TonneForce": 15
"TonneForce": 15,
"GramForce": 16
},
"ForceChangeRate": {
"CentinewtonPerSecond": 1,
Expand Down
12 changes: 12 additions & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Quantities/Force.g.cs

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

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

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.

8 changes: 8 additions & 0 deletions UnitsNet.Tests/CustomCode/ForceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class ForceTests : ForceTestsBase
protected override double DecanewtonsInOneNewton => 1E-1;
protected override double DyneInOneNewton => 1E5;

protected override double GramsForceInOneNewton => 0.1019716e3;
protected override double KilogramsForceInOneNewton => 0.1019716;

protected override double KilopoundsForceInOneNewton => 0.2248089e-3;
Expand Down Expand Up @@ -110,5 +111,12 @@ public void KilogramForceDividedByNewtonEqualsStandardGravity()
var duration = Force.FromKilogramsForce(1) / Force.FromNewtons(1);
Assert.Equal(9.80665, duration);
}

[Fact]
public void ThousandGramsForceEqualsOneKilogramForce()
{
var force = Force.FromGramsForce(1000);
Assert.Equal(Force.FromKilogramsForce(1), force.ToUnit(ForceUnit.KilogramForce));
}
}
}
Loading
Loading