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

Convert between "units" #67

Open
dovy opened this issue Jun 27, 2021 · 3 comments
Open

Convert between "units" #67

dovy opened this issue Jun 27, 2021 · 3 comments
Assignees
Labels

Comments

@dovy
Copy link

dovy commented Jun 27, 2021

I would like to take a resulted mass and convert it from say lb (pounds) to oz (ounces). Is that possible with this library?

If I add a unit of a given value (say 1oz) and subtract then it properly converts, but I need the true value.

Thanks in advance!

@dovy
Copy link
Author

dovy commented Jun 27, 2021

I then saw some other issues with suggestions on using the alpha, so I installed version 4.0a7.

Now the following code block:

from measurement.utils import guess
print(guess(23, "g"))

Yields this error:
ValueError: can't guess measure for '23 g'

Any guidance would be appreciated.

@dovy
Copy link
Author

dovy commented Jun 28, 2021

Ping? :P

@codingjoe
Copy link
Collaborator

Pong! Sorry for the delay. Is there any particular reason you are using guess instead of Mass("23 g").oz?

@codingjoe codingjoe self-assigned this Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants