Skip to main content

parse_numeric_string

Function parse_numeric_string 

Source
pub fn parse_numeric_string(s: &str, translator_name: &str) -> Option<f64>
Expand description

Parse a translated string value into a numeric f64.

Uses the translator name to determine parsing strategy:

  • Names containing “hex” parse as hexadecimal
  • Names containing “bin” parse as binary
  • Otherwise tries decimal, with hex fallback

Returns None if the string cannot be parsed as a number.