Skip to content
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

Should "%" times "m" result in "m" by default? #188

Open
kendonB opened this issue Jan 22, 2019 · 3 comments
Open

Should "%" times "m" result in "m" by default? #188

kendonB opened this issue Jan 22, 2019 · 3 comments

Comments

@kendonB
Copy link
Contributor

kendonB commented Jan 22, 2019

library(units)
#> udunits system database from C:/R/Library/3.5/units/share/udunits
as_units(10, "%") * as_units(10, "m")
#> 100 [%*m]

Created on 2019-01-22 by the reprex package (v0.2.1.9000)

I would have expected to see:

as_units(10, "%") * as_units(10, "m")
#> 1 [m]

Of course, this is a general issue for all continuous units where 0 is meaningful.

@edzer
Copy link
Member

edzer commented Jan 22, 2019

The issue is really whether 10 [%] should automatically simplify to 0.1 [1], since

> set_units(0.1, 1) * set_units(10, m)
1 [m]

There are earlier threads where we discussed this, and concluded that maximal simplification is not what most users will want.

@Enchufa2
Copy link
Member

And still, [%*m] seems odd...

@kendonB
Copy link
Contributor Author

kendonB commented Jan 22, 2019

I agree that most users would not want to automatically simplify % to 1. But when multiplying with a measurement unit like above? Surely no one is interested in how many % kgs something is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants