def money.cents
import cswap-bend-cli@0.1.0.0/render.bend as Renderimport Base
import cswap-bend-cli@0.1.0.0/clock.bend as Clock
63def money.cents(+i: String, +f: String) -> String:
64 money.fmt(Maybe.default(&2, U32, Maybe.bind(&2, U32, U32, U32.read(i), x => Maybe.bind(&2, U32, U32, Clock.num(f ++ "000", 0n, 2n), y => Maybe.bind(&2, U32, U32, Clock.num(f ++ "000", 2n, 1n), z => Some{(x * 100 + y + Clock.sel(U32.is_ge(z, 5), 1, 0) : U32)}))), 0))