Calculation field: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
Line 121: Line 121:
! Function !! Arguments !! Returns
! Function !! Arguments !! Returns
|-
|-
| '''if''' || ''expression,<br/>valueIfTrue,<br/>valueIfFalse'' || One value if a logical expression is TRUE (not equal to 0.0)<br/>and another if it is FALSE (equal to 0.0)<br/>Read it as "If ''expression'' is true, then ''valueIfTrue'', else ''valueIfFalse''"<br/>Example: if(#{remaining} == 0, 'Done', 'Incomplete')
| '''if''' || ''expression,<br/>valueIfTrue,<br/>valueIfFalse'' || One value if a logical expression is TRUE (not equal to 0.0)<br/>and another if it is FALSE (equal to 0.0)<br/>Read it as "If ''expression'' is true, then ''valueIfTrue'', else ''valueIfFalse''"
<source lang="JavaScript">
if(#{remaining} == 0, 'Done', 'Incomplete')
</source>
|-
|-
| '''switch''' || ''expression,<br/>valueResultPairs,<br/>defaultResult'' || 1+(2*#pairs)+1 arguments<br/>The final result based on matching ''expression'' against the paired '''values''' to identify the paired '''result''' (or else ''defaultResult'') to be used
| '''switch''' || ''expression,<br/>valueResultPairs,<br/>defaultResult'' || 1+(2*#pairs)+1 arguments<br/>The final result based on matching ''expression'' against the paired '''values''' to identify the paired '''result''' (or else ''defaultResult'') to be used

Navigation menu