-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New unit: Force.ShortTonForce #821
Conversation
Codecov Report
@@ Coverage Diff @@
## master #821 +/- ##
=======================================
Coverage 80.53% 80.54%
=======================================
Files 281 281
Lines 41905 41915 +10
=======================================
+ Hits 33750 33760 +10
Misses 8155 8155
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few questions, the rest looks good!
Sounds good! I'll make changes tomorrow morning.
…On Sat, Aug 8, 2020, 4:59 PM Andreas Gullberg Larsen < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Common/UnitDefinitions/Force.json
<#821 (comment)>:
> @@ -163,6 +163,20 @@
"Abbreviations": [ "кипф", "койка", "К" ]
}
]
+ },
+ {
+ "SingularName": "ShortTonForce",
+ "PluralName": "ShortTonsForce",
+ "FromUnitToBaseFunc": "x*8.896443230521e3",
+ "FromBaseToUnitFunc": "x/8.896443230521e3",
+ "XmlDocSummary": "The short ton-force is a unit of force equal to 2,000 pounds-force (907.18474 kgf), that is most commonly used in the United States – known there simply as the ton or US ton.",
+ "XmlDocRemarks": "https://en.wikipedia.org/wiki/Ton-force#Short_ton-force",
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "sh tn", "T" ]
use something like .ToUpper() or .ToLower()
We recently introduced case insensitive parsing, unless two units of the
same quantity differ only by casing (rare). #781
<#781>
So we don't have to define both upper/lower variants in JSON, but the one
we define will be used by ToString() though.
A few more observations:
- Ton-force wiki <https://en.wikipedia.org/wiki/Ton-force> uses 1
short tons-force
- Force.TonneForce
<https://github.com/angularsen/UnitsNet/blob/master/Common/UnitDefinitions/Force.json#L49-L57>
uses Ton (seems wrong to me? Ton-force wiki
<https://en.wikipedia.org/wiki/Ton-force> suggests tf)
I also would prefer to try to stay consistent with Mass and Force
abbreviations unless it goes against conventions in the domain.
How about something like this:
# ShortTonneForce (I personally prefer "tf (short)" as the primary, but no strong opinion other than consistency with other quantities)
"Abbreviations": [ "tf (short)", "t (US)f", "short tons-force" ]
# TonneForce (add "tf", keep Ton to not break backwards compatibility in v4.x)
"Abbreviations": [ "tf", "Ton" ]
# Mass (add "t (short)" and make it primary)
"Abbreviations": [ "t (short)", "short tn", "ST" ]
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#821 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADULO34ZTFM5APSNJPQ4QVTR7W4EDANCNFSM4PXVKAKQ>
.
|
…ass.ShortTon Attempting to standardize the abbreviation format between tonne/ton for mass and force without introducing breaking changes.
Perfect! Nuget is on the way out. |
Fixes #819