pub fn count_significant_figures(price_str: &str) -> Result<usize, String>Expand description
Count significant figures in a price string.
Rules for counting significant figures:
- Leading zeros after decimal point are NOT significant (0.00123 -> 3 sig figs)
- Trailing zeros before decimal point are NOT significant (12300 -> 3 sig figs)
- Trailing zeros after decimal point ARE significant (123.00 -> 5 sig figs)
- All non-zero digits are significant