-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add prefixes for watt-hours and ampere-hours #112
Add prefixes for watt-hours and ampere-hours #112
Conversation
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.
Thanks for the PR! I only found a couple description issues. Once resolved I'll plan on merging. I can also release a v0.21.1 if there aren't any other changes you need for battery (very cool crate).
src/si/electric_charge.rs
Outdated
@@ -36,8 +36,18 @@ quantity! { | |||
@zeptocoulomb: prefix!(zepto); "zC", "zeptocoulomb", "zeptocoulombs"; | |||
@yoctocoulomb: prefix!(yocto); "yC", "yoctocoulomb", "yoctocoulombs"; | |||
|
|||
@abcoulomb: 1.0_E1; "abC", "abcoulomb", "abcoulombs"; | |||
@petaampere_hour: 3.6_E18; "PA · h", "petaampere_hour", "petaampere hours"; |
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.
Remove _
from petaampere_hour
and teraampere_hour
descriptions.
src/si/energy.rs
Outdated
@@ -36,6 +36,17 @@ quantity! { | |||
@zeptojoule: prefix!(zepto); "zJ", "zeptojoule", "zeptojoules"; | |||
@yoctojoule: prefix!(yocto); "yJ", "yoctojoule", "yoctojoules"; | |||
|
|||
@petawatt_hour: 3.6_E18; "PW · h", "petawatt_hour", "petawatt hours"; |
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.
Remove _
from petawatt_hour
and terawatt_hour
descriptions.
src/si/energy.rs
Outdated
@hectowatt_hour: 3.6_E5; "hW · h", "hectowatt hour", "hectowatt hours"; | ||
@decawatt_hour: 3.6_E4; "daW · h", "decawatt hour", "decawatt hours"; | ||
@watt_hour: 3.6_E3; "W · h", "watt hour", "watt hours"; | ||
@milliwatt_hour: 3.6_E0; "mW· h", "milliwatt hour", "milliwatt hours"; |
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.
Add a space before the ·
.
src/si/energy.rs
Outdated
@decawatt_hour: 3.6_E4; "daW · h", "decawatt hour", "decawatt hours"; | ||
@watt_hour: 3.6_E3; "W · h", "watt hour", "watt hours"; | ||
@milliwatt_hour: 3.6_E0; "mW· h", "milliwatt hour", "milliwatt hours"; | ||
@microwatt_hour: 3.6_E-3; "µW ⋅ h", "microwatt hour", "microwatt hours"; |
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.
Switch from ⋅
to ·
.
All done. There is nothing more I need for battery crate, just the few milliamperes and maybe a couple of milliwatt-hours, so new Btw, thanks for this crate, I have found one logic bug already while integrating it :) |
Could you squash your PR into a single commit and then I'll merge. I already started writing up v0.21.1 notes so that will be published shortly. Great to hear |
Oh, no, wait there is a missing space in a mAh |
I'm sorry for this mess. I think this is impossible to find this commit right now, but as far as I remember, I was multiplying microamperes to voltage in order to get microwatt-hours, while microampere-hours should be used there. |
Thanks again for the PR. v0.21.1 published! |
Hey, @iliekturtles !
I'm integrating
uom
into the battery crate and there are few prefixes forwatt-hours
andampere-hours
that I really could use but there are missing.Not quite sure if it is worth to add prefixes smaller than micro- though. Any thoughts?