Tagged money
13 capabilities
money.split-even
Split an amount into n near-equal parts that add back up to exactly the whole.
split_even in Rust
math.round-div
Integer division with an explicit rounding mode, for money arithmetic that must not drift.
round_div in Rust
math.round-div-big
Divide two integers of any size with an explicit rounding mode, on decimal strings, for exact money sums past 2^53.
round_div_big in Rust
money.allocate
Split an amount across ratios without losing or inventing a single minor unit.
allocate in Rust
money.apply-rate
Apply a rate expressed in basis points to a monetary amount, with an explicit rounding mode.
apply_rate in Rust
money.compare
Compare two amounts of one currency, refusing to compare across currencies; min, max and clamp too.
A group of 4:
compare_money, min_money, max_money, clamp_money
money.convert
Convert an amount to another currency at a supplied exact rate, with an explicit rounding mode.
convert_money in Rust
money.currency-digits
How many decimal places a currency's minor unit has, from the ISO 4217 list.
currency_digits in Rust
money.format
Render a monetary amount as text, using the currency's real minor-unit precision.
format_money in Rust
money.parse
Parse "£1,234.50" or "1.234,50 €" into integer minor units, strictly: no guessing, no rounding.
parse_money in Rust
money.sum
Total a list of monetary amounts, with an explicit currency for the empty case.
sum_money in Rust