diff options
Diffstat (limited to 'stdlib/source/library/lux/world/finance/money.lux')
-rw-r--r-- | stdlib/source/library/lux/world/finance/money.lux | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/stdlib/source/library/lux/world/finance/money.lux b/stdlib/source/library/lux/world/finance/money.lux index cd0724459..a32f05943 100644 --- a/stdlib/source/library/lux/world/finance/money.lux +++ b/stdlib/source/library/lux/world/finance/money.lux @@ -31,15 +31,18 @@ [#currency currency #amount amount])) - (def .public (of_units currency it) - (All (_ currency) - (-> (/.Currency currency) Nat - (Money currency))) - (money currency - (n.* (/.sub_divisions currency) - it))) - - (def .public of_sub_units money) + (with_template [<*> <name>] + [(def .public (<name> currency it) + (All (_ currency) + (-> (/.Currency currency) Nat + (Money currency))) + (money currency + (<*> (/.sub_divisions currency) + it)))] + + [n.* of_units] + [n.% of_sub_units] + ) (with_template [<name> <slot> <type>] [(def .public <name> |