-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
New Unit - Grade (Slope) #1337
Comments
I think this sounds useful and has a wide range of applications. Detailed steps here: I'm happy to assist. |
Thanks @angularsen! The description for a PR looks very manageable, I’ll gladly give it a shot. I could definitely use some help with the fraction part, though. Let me cook up a first sketch and submit it as a draft PR so that I can ask for more specific feedback. [EDIT] This is relevant: UnitsNet/UnitsNet/CustomCode/Quantities/Length.extra.cs Lines 238 to 313 in 67e16c6
|
Sorry to interfere. I personally think its more useful to extend the usage of an existing generic quantity rather than introducing a different quantity that represents the same thing. |
I generally agree with your suggestion @tm-ren. But how would you treat the angle conversion to degrees? Does it make sense to have an angle as a generic Ratio unit? |
An angle is a ratio technically. Consider: Angles are special enough that it makes sense they are quantities in their own right. |
Makes sense. I need a simple way of converting between units too. As far as I know, one can only convert between units within the same Quantity, or can a cross-quantity conversion be easily implemented? |
Good point!
I thought at first there were new units here that justified having a
separate quantity, but I realize now that it may be better to reuse Ratio
and instead offer methods or extension methods to convert to Angle 👍
…On Wed, Dec 13, 2023, 11:44 mariuszhermansdorfer ***@***.***> wrote:
Makes sense. I need a simple way of converting between units too. As far
as I know, one can only convert between units within the same Quantity, or
can a cross-quantity conversion be easily implemented?
—
Reply to this email directly, view it on GitHub
<#1337 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGAK2APBULVJSFKN6VHWDDYJGBJDAVCNFSM6AAAAABAOY452OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJTGY3TMMJUHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
How do you suggest we proceed from now? I guess #1338 should be ignored then. Please let me know how I can help. |
Out sick today, will get back to you on this.
|
@mariuszhermansdorfer I propose this:
The units you requested should then already be covered by either
Creating string "1/2" is currently not supported, but maybe something we could add to Ratio if useful. |
Makes sense @angularsen. I'll act accordingly. |
Is your feature request related to a problem? Please describe.

In architecture and landscape architecture, there are multiple ways of representing a grade:
It can be defined as:
Describe the solution you'd like
I'd like
UnitsNet
to group all the above representations within oneGradeUnit
to allow for seamless conversions. Currently, using theRatioUnit
, it is possible to convert from a percent value to per mille, but angle is missing. Also, it'd be great to have support for fractions. similarly to how theLengthUnit
supports feet and inches.The text was updated successfully, but these errors were encountered: