bbodi/notecalc3

Conditionals and comparisons

bbodi opened this issue · 3 comments

bbodi commented
cost = 500
discount = true
cost = if discount then cost - 10% else cost
cost = if discount then cost - 10% 
cost = cost - 10% if discount

(if discount then 5% else 2%) + 3%

earnings = $45k                             | $45,000.00
tax = if earnings > $30k then 20% else 5%
My tax paid: earnings * tax                 | $9,000.00

a ? b : c

bbodi commented

Currently I don't support this syntax.

It has only a tiny benefit over the proposed syntax (fewer characters) but has zero meaning for non-developers.

Implemented in 0.4.0