Skip to main content

normalize_numeric_with_unit

Function normalize_numeric_with_unit 

Source
fn normalize_numeric_with_unit(
    numeric_str: &str,
    unit: TimeUnit,
) -> Result<(BigInt, TimeUnit), String>
Expand description

Convert a numeric string into an integer BigInt and normalized TimeUnit.

Decimal inputs are scaled by selecting a smaller unit so the numeric part is an integer. Example: “1.5” with unit ns -> 1500 ps.