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

Error in units #49

Open
Serafinowy opened this issue Dec 15, 2024 · 1 comment
Open

Error in units #49

Serafinowy opened this issue Dec 15, 2024 · 1 comment

Comments

@Serafinowy
Copy link

If i wanted to create for example a unit ohm/ampere it doesn't work
qty("0","ohm/ampere")
I have an error
Panicked with: "invalid unit: ohm"

But if i want to do them separately it works
qty("0","ohm")
qty("0","ampere")

@ChHecker
Copy link
Owner

Currently, this is intended behavior. Using / is reserved for the shorthand notation, and the full notation requires the word per instead.
So the two options are

qty("0", "ohm per ampere")
// or
qty("0", "O/A")

Now, whether that's sensible is another question. If you were confused by this, you're probably not the only one. I will consider changing this, and I'm open to pull requests.

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

2 participants