Function determine_pre_and_post_decimal_strings

Source
fn determine_pre_and_post_decimal_strings(
    value: &str,
) -> (String, Option<String>)
Expand description

determine_pre_and_post_decimal_strings attempts to determine if there is a decimal point in the value string, and if so, it will returned the split string based on the location of the decimal point.

The only supported decimal points are ‘.’, ‘,’, and ’ ’.

This implementation takes advantage of the notion that the decimal point is the last symbol in a string representation of a number. This may potentially return false positives in some cases, but it’s best to assume that the value is formatted with a decimal rather than a grouping separator instead.

For convenience the returned strings are pruned of any non-numeric value.