Skip to main content

to_money

Function to_money 

Source
pub fn to_money(currency: &str, amount: Money) -> Option<Money>
Expand description

(currency, amount) -> google.type.Money, exactly. The reverse of money.

None when the amount has more than 9 decimal places (nanos counts billionths) or its integer part does not fit in an i64: the amount is never rounded in silence. units and nanos carry the sign of the amount.