notecalc3 icon indicating copy to clipboard operation
notecalc3 copied to clipboard

Conditionals and comparisons

Open bbodi opened this issue 5 years ago • 2 comments

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

bbodi avatar Jan 02 '21 16:01 bbodi

a ? b : c

TechPlasma avatar Jan 04 '21 00:01 TechPlasma

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.

bbodi avatar Jan 04 '21 06:01 bbodi