RosettaCodeData/Task/Currency/Langur/currency.langur
2026-04-30 12:34:36 -04:00

19 lines
403 B
Text

# use banker's rounding
mode rounding = _round'halfeven
val hamburgers = 4000000000000000
val milkshakes = 2
val price_hb = 5.50
val price_ms = 2.86
val taxrate = 7.65
val pretax = hamburgers * price_hb +
milkshakes * price_ms
val tax = round(pretax * taxrate / 100, places=2)
val total = pretax + tax
writeln "before tax: $", pretax
writeln " tax: $", tax
writeln " total: $", total