Currency: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Minor tidy) |
No edit summary |
||
Line 2,259: | Line 2,259: | ||
{{out}} |
{{out}} |
||
net=22000000000000005.72, tax=1683000000000000.44, total=23683000000000006.16 |
net=22000000000000005.72, tax=1683000000000000.44, total=23683000000000006.16 |
||
=={{header|Unicon}}== |
|||
Solution takes advantage of Unicon FxPt class as well as Unicon's operator overloading extension. |
|||
<syntaxhighlight lang="unicon">import math |
|||
procedure main() |
|||
n_burgers := 4000000000000000 |
|||
n_shakes := 2 |
|||
price := (FxPt(5.50) * n_burgers + FxPt(2.86) * n_shakes).round(2) |
|||
tax := (price * FxPt(7.65/100)).round(2) |
|||
total := price + tax |
|||
write(left("Price", 10), "$", right(price.toString(),21)) |
|||
write(left("Tax", 10), "$", right(tax.toString(),21)) |
|||
write(left("Total", 10), "$", right(total.toString(),21)) |
|||
end</syntaxhighlight>{{out}} |
|||
<pre>Price $ 22000000000000005.72 |
|||
Tax $ 1683000000000000.44 |
|||
Total $ 23683000000000006.16</pre> |
|||
=={{header|VBA}}== |
=={{header|VBA}}== |