Allow ability to delete default units #3442
Replies: 4 comments 2 replies
-
|
I've found a few possibilities 5 / s to s^-1 # 5 s^-1
a = unit(5, "1/s") # 5 s^-1
a + 1/s # 6 s^-1Another possibility is to use Maybe there is a trick to your use case, can you show your code that converts |
Beta Was this translation helpful? Give feedback.
-
|
I agree with @dvd101x; the "Hz" unit is just a synonym for And indeed, in JavaScript rather than MaJE (the MathJs Expressions language) we have So if you are handling these units in JavaScript, you could just manually set the |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the suggestions, for whatever reason the overrides weren't working but I was able to solve this by deleting all the references to hertz and frequency like It might be nice to expose an api to handle deleting an entire system as I believe this won't delete from the _findUnit cache. |
Beta Was this translation helpful? Give feedback.
-
|
is there a flag under math.config that allow or disable usage of units ? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
Currently a scalar divided by a time unit such as
5/secondswill get converted into hertz5Hz. However, for my usecase, hertz(hz) doesn't make sense to convert into. Ideally it would be possible to keep the evaluated value as5/secondsand not simplify any further.I have tried
math.Unit.deleteUnit('Hz')and
delete math.Unit.UNITS['hertz'];and neither seemed to have any impact. Open to any thoughts or ideas! Thanks in advance :)
Beta Was this translation helpful? Give feedback.
All reactions