Skip to main content

money

Function money 

Source
pub fn money(currency: &str, s: &str) -> MoneyValue
Expand description

money_from_str for a literal that is known to be right (tests, examples, imitations).

§Panics

If the text is not a number with at most 9 decimals.

§Examples

let m = brokapi_tbank_protocol::money::money("rub", "-4");
assert_eq!((m.units, m.nano), (-4, 0));