Skip to main content

format_amount

Function format_amount 

Source
pub fn format_amount(num: i128, denom: i64) -> Option<String>
Expand description

Renders num/denom so the amount parser reads back the same reduced value: the exact decimal when it terminates and the parser accepts it, otherwise the reduced fraction a/b. Never rounds. None for a zero denominator or a value the parser cannot hold.