Module monetary_value

Source

Structsยง

MonetaryValue
MonetaryValues is a struct that paris a CurrencyCode with a value. This structure is able to represent both positive and negative currencies.
MonetaryValueVisitor ๐Ÿ”’

Functionsยง

determine_pre_and_post_decimal_strings ๐Ÿ”’
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.
is_ascii_digit ๐Ÿ”’
is_ascii_digit is a convenience function for converting char::is_ascii_digit into a function that conforms to [Pattern].
is_possibly_a_decimal_point ๐Ÿ”’
parse_pre_and_post_decimal_digits ๐Ÿ”’
reorder_currency_code_and_value ๐Ÿ”’
Reorder the currency code and the value strings into the expected order. This is done to simplify the down-stream parsing logic as we will be able to assume that the first element of the pair is the string containing the currency code, and the second part of the pair is the portion of the string that contains the monetary value.
split_str_into_currency_code_and_value_string ๐Ÿ”’
Split a string into a currency code and a value strings in order to simplify parsing the string into a MonetaryValue.