You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to convert Celsius to its base unit Kelvin using the following code:
SystemOfUnits system = UCUM.Load();
Quantity quantity = new Quantity(39m, system.Metric("Cel"));
quantity = system.Canonical(quantity);
But it fails with the exception "Quantity could not be converted to base units" on the method call system.Canonical.
Debugging Fhir.Metrics I see that an exception is thrown on the following line UcumReader.cs#L132 since the unit definition in ucum-essence.xml#L311 is deviating a bit from the other unit definitions, lacking the value attribute on the node unit/value, maybe by design. Still the conversion is not loaded into memory, as far as I can see, because of the exception.
The text was updated successfully, but these errors were encountered:
* A temporarily workaround for converting Celsius to Kelvin
* Note: internal searchindex stores all UCUM units in its base unit
* See: FirelyTeam/Fhir.Metrics#7
I am trying to convert Celsius to its base unit Kelvin using the following code:
But it fails with the exception "Quantity could not be converted to base units" on the method call system.Canonical.
Debugging Fhir.Metrics I see that an exception is thrown on the following line UcumReader.cs#L132 since the unit definition in ucum-essence.xml#L311 is deviating a bit from the other unit definitions, lacking the value attribute on the node unit/value, maybe by design. Still the conversion is not loaded into memory, as far as I can see, because of the exception.
The text was updated successfully, but these errors were encountered: