Skip to content

v5.0.1 - Plain-digit exponents parse in five unit parsers

Choose a tag to compare

@pjazdzyk pjazdzyk released this 24 Sep 23:16
· 17 commits to master since this release

A fix release. No quantity, unit or conversion factor changes.

Fixed: plain-digit exponents in five unit parsers

A unit written with a superscript exponent now also parses when the exponent is typed as a plain digit, which
is how every keyboard and every API client writes it. Five unit enums did not normalise the two forms, so
"450Nm3/h" was refused while "450Nm³/h" and "12m3/h" parsed:

  • NormalVolumetricFlow: Nm3/h, Nm3/s, Nm3/min, Sm3/h
  • HeatFlux: W/m2, kW/m2
  • EnergyDensity: J/m3, kWh/m3 and the rest
  • MassFlux and AirFuelRatioVolume, wherever their symbols parse at all

Tests

A registry-wide test now holds every unit to it: when a unit's superscript spelling parses, its plain-digit
spelling must parse to the same unit, so a new unit enum cannot bring the defect back.