pub fn parse_si_value<T>(s: &str) -> Result<T>Expand description
Parse a numeric value with optional SI suffix (k, M, G)
Supports both integer and floating-point values with SI multipliers:
korK: multiply by 1,000 (kilo)M: multiply by 1,000,000 (mega)G: multiply by 1,000,000,000 (giga)
ยงExamples
use desperado::parse_si_value;
assert_eq!(parse_si_value::<u32>("1090M").unwrap(), 1090000000);
assert_eq!(parse_si_value::<u32>("2400k").unwrap(), 2400000);
assert_eq!(parse_si_value::<u32>("1090000000").unwrap(), 1090000000);
assert_eq!(parse_si_value::<f64>("2.4M").unwrap(), 2400000.0);
assert_eq!(parse_si_value::<i64>("1090M").unwrap(), 1090000000);