Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Currency/Tcl/currency.tcl
Normal file
14
Task/Currency/Tcl/currency.tcl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package require math::decimal
|
||||
namespace import math::decimal::*
|
||||
|
||||
set hamburgerPrice [fromstr 5.50]
|
||||
set milkshakePrice [fromstr 2.86]
|
||||
set taxRate [/ [fromstr 7.65] [fromstr 100]]
|
||||
|
||||
set burgers 4000000000000000
|
||||
set shakes 2
|
||||
set net [+ [* [fromstr $burgers] $hamburgerPrice] [* [fromstr $shakes] $milkshakePrice]]
|
||||
set tax [round_up [* $net $taxRate] 2]
|
||||
set total [+ $net $tax]
|
||||
|
||||
puts "net=[tostr $net], tax=[tostr $tax], total=[tostr $total]"
|
||||
Loading…
Add table
Add a link
Reference in a new issue