overpunch

Function convert_from_signed_format

source
pub fn convert_from_signed_format(
    value: &str,
    field_format: &str,
) -> Option<Decimal>
Expand description

Returns a Decimal parsed from an appropriate signed overpunch respresentation.

§Arguments

  • value - The signed overpunch representation.
  • field_format - The signed overpunch picture format.

§Example


let number = convert_from_signed_format("2258{", "s9(7)v99").unwrap();
assert_eq!(number, Decimal::from_str_exact("225.8").unwrap());