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 Quantity to most fitting Prefix #365

Open
keilw opened this issue Feb 26, 2022 · 1 comment
Open

Convert Quantity to most fitting Prefix #365

keilw opened this issue Feb 26, 2022 · 1 comment

Comments

@keilw
Copy link
Member

keilw commented Feb 26, 2022

I will transfer this to Indriya to explore possible functions like that.

Originally posted by @keilw in unitsofmeasurement/unit-api#236 (comment)

@keilw keilw changed the title I will transfer this to Indriya to explore possible functions like that. Convert Quantity to most fitting Prefix Feb 26, 2022
@keilw keilw added the function label Feb 26, 2022
@puigru
Copy link

puigru commented Feb 27, 2022

For reference, I found a units library for Python which offers something like this.


Source: https://pint.readthedocs.io/en/stable/developers_reference.html#pint.Quantity.to_compact

It also has to_base_units() which can be used to reverse the process.

@keilw keilw added the deferred label Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants