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

Auto-detect unit prefixes #14

Open
Splines opened this issue Jan 5, 2024 · 0 comments
Open

Auto-detect unit prefixes #14

Splines opened this issue Jan 5, 2024 · 0 comments
Labels
idea An idea for a new feature

Comments

@Splines
Copy link
Collaborator

Splines commented Jan 5, 2024

The lib could automatically detect if an exponent divisible by 3 is used. In this case,

(\num{42.3} \pm \num{1.2}) \cdot 10^{-9} \unit{\V}

it could output the following instead:

(\num{42.3} \pm \num{1.2}) \unit{\nano \V}

If implemented, things to consider:

  • If we're very close to a "nice" exponent (divisible by 3), should we round differently? Probably not.
  • Have to make sure that "\nano" and the like always works within \unit{...}
  • What if the user already specified a unit prefix in the unit string (and still the number uses some exponent)?
@Splines Splines added the idea An idea for a new feature label Mar 28, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
idea An idea for a new feature
Projects
None yet
Development

No branches or pull requests

1 participant