-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
The problem is related to #2499 but it was not fixed by the corresponding PR.
When we convert units from degC to K in SciCat they are wrongly converted by toSI() i.e. without adding the offset (SciCatProject/backend#926 ).
In physics you never use Celsius to describe a difference of two various temperatures by always Kelvin
so during conversion from degC to K the offset should be always added.
You can workaround the problem using twice unit() , to() and toSi() but it looks complicated.
Is this behavour expected?
To Reproduce
> const { unit, version } = await import("mathjs");
> 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 }Reactions are currently unavailable