Skip to main content

Module parser

Module parser 

Source
Expand description

Parser for "<value> <unit>" strings.

Examples:

  • "25 degC" โ†’ (25.0, "degC")
  • "3.5 barg" โ†’ (3.5, "barg")
  • "-1.2e-3 kJ/kmol" โ†’ (-1.2e-3, "kJ/kmol")

Functionsยง

split_value_unit
Split a string of the form "<numeric value> <unit symbol>" into its (value, unit) parts. Whitespace between the two is required.