-
Notifications
You must be signed in to change notification settings - Fork 25
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
"300 degC" wrongly converted to "300 K" #926
Comments
I've added the patch to #925 |
Related to josdejong/mathjs#2499 ( and a mathjs upgrade on our side?) |
Hi @bpedersen2, In the mathjs 12.1.0 still exists so it looks like the problem was not fixed by josdejong/mathjs#2499 (mynodeenv) (myenv) jkotan@xpsjk:~/nest2$ nodejs
Welcome to Node.js v21.3.0.
Type ".help" for more information.
> const { unit, version } = await import("mathjs");
undefined
> version
'12.1.0'
> unit("300 degC").toSI().toJSON()
{ mathjs: 'Unit', value: 300, unit: 'K', fixPrefix: true }
> unit(300, "degC").to(unit("degC").toSI()).toJSON()
{ mathjs: 'Unit', value: 573.15, unit: 'K', fixPrefix: true } |
@jkotan given that the discussion regarding arrays in Scientific Metadata requires more time to be resolved, could you please isolate the code to solve the problem highlighted in this issue in a separate PR? |
Summary
"300 degC" is wrongly converted to "300 K". Probably it is a bug in mathjs. I tested with (10.2.4).
Steps to Reproduce
to reproduce it one can store a scalar value with 'degC' unit or simpler in nodejs
Expected Behaviour
Extra Details
Workaround for the problem could be to change the above line of the code in convertToSI to something like
which gives the correct result
The text was updated successfully, but these errors were encountered: