User Tools

Site Tools


en:cachevariables

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
en:cachevariables [2022/02/22 10:13] – [Formula syntax] lineflyeren:cachevariables [2022/02/22 10:20] – [Functions] lineflyer
Line 82: Line 82:
 |Integer | Number without decimal places | Use digits | ''1234'', ''-3''| |Integer | Number without decimal places | Use digits | ''1234'', ''-3''|
 |Decimal | Number with decimal places | Use digits with decimal point or comma | ''3.14'', ''-3.14'', ''3,14''| |Decimal | Number with decimal places | Use digits with decimal point or comma | ''3.14'', ''-3.14'', ''3,14''|
-|String | Text | Surround value with '' ''' or ''"''\\  To use the '' ' '' or '' " '' their selves, type '' **FIXME** '' or '' "" ''| '' 'test''', ''"test"''\\ ''"He said ""yes""!"''|+|String | Text | Surround value with ''%%'%%'' or ''%%"%%''\\  To use the ''%%'...'%%'' or ''%%"..."%%'' their selves, type ''%%''%%'' or ''%%""%%''| ''%%'test'%%'', ''%%"test"%%''\\ ''"He said ""yes""!"''|
  
-**FIXME** using monotext does not work for ' in this table as its also part of the monotext syntax in Dokuwiki. :( 
  
 ==== Numeric operators ==== ==== Numeric operators ====
Line 91: Line 90:
  
 ^ Operator ^ Function ^ Example ^ ^ Operator ^ Function ^ Example ^
-|+|Addition|''2+4'' evaluates to '' 6''+|''+''|Addition|''2+4'' evaluates to '' 6''
-|-|Subtraction (or negating a number)|''6-4'' evaluates to ''2''\\ ''-(5-2)'' evaluates to ''-3''+|''-''|Subtraction\\ (or negating a number)|''6-4'' evaluates to ''2''\\ ''-(5-2)'' evaluates to ''-3''
-|*|Multiplication|''3*4'' evaluates to ''12''+|''*''|Multiplication|''3*4'' evaluates to ''12''
-|/|Division|''12/3'' evaluates to ''4''+|''/''|Division|''12/3'' evaluates to ''4''
-|%|Modulo|''12%5'' evaluates to ''2''+|''%''|Modulo|''12%5'' evaluates to ''2''
-|**FIXME**|Potentiate|''3^3'' evaluates to ''9''+|''^''|Potentiate|''3^3'' evaluates to ''9''
-|!|Factorize|''4!'' evaluates to ''24''|+|''!''|Factorize|''4!'' evaluates to ''24''|
  
 ==== Relational operators and conditions ==== ==== Relational operators and conditions ====
Line 136: Line 135:
 |''sin''/''cos''/''tan'' |-| calculates sinus/cosinus/tangens of given parameter | numeric parameter in degree(!)| - | ''sin(90)'' evaluates to ''1''| |''sin''/''cos''/''tan'' |-| calculates sinus/cosinus/tangens of given parameter | numeric parameter in degree(!)| - | ''sin(90)'' evaluates to ''1''|
 |''abs''|-| calculates absolute value | numeric parameter | - | ''abs(-34)'' evaluates to ''34''| |''abs''|-| calculates absolute value | numeric parameter | - | ''abs(-34)'' evaluates to ''34''|
-|''round''|-| rounds decimal values mathematically | value to round | optional: number of places to round to | ''round(4.65)'' evaluates to ''5'', ''round(4.65; 1)'' evaluates to ''4.7''|+|''round''|-| rounds decimal values mathematically | value to round | optional: number of places to round to | ''round(4.65)'' evaluates to ''5'', ''round(4.65;1)'' evaluates to ''4.7''|
 |''if''|-| evaluates conditions and returns conditional values | list of if-then-else-values. See previous section for details | - | ''if(3<4;5;6)'' evaluates to ''5''| |''if''|-| evaluates conditions and returns conditional values | list of if-then-else-values. See previous section for details | - | ''if(3<4;5;6)'' evaluates to ''5''|
 |''checksum''|''cs''| calculates checksum of given numeric value. Calculates lettervalue if given paramter is of type text | positive integer or text | - | ''checksum(345)'' evaluates to ''12''| |''checksum''|''cs''| calculates checksum of given numeric value. Calculates lettervalue if given paramter is of type text | positive integer or text | - | ''checksum(345)'' evaluates to ''12''|
Line 186: Line 185:
   * The Formula ''1_A'' with ''A=2'' will evaluate to ''102''   * The Formula ''1_A'' with ''A=2'' will evaluate to ''102''
   * The Formula ''1_A'' with ''A=23'' will evaluate to ''123''   * The Formula ''1_A'' with ''A=23'' will evaluate to ''123''
-  * The Formula ''1__A'' with ''A=23'' will evaluate to ''1023'' +  * The Formula ''%%1__A%%'' with ''A=23'' will evaluate to ''1023'' 
-  * The Formula ''1__A'' with ''A=234'' will evaluate to ''1234''+  * The Formula ''%%1__%%A'' with ''A=234'' will evaluate to ''1234'' 
  
-**FIXME** Double underscore is interpreted as underline by Dokuwiki 
 ==== Range expressions ==== ==== Range expressions ====
  
-You can specify ranges in formulas using ''[]''. This is needed when variables are used in a context where a range of values should be iterated over. A prominent example is the "Generate Waypointsfunction.+You can specify ranges in formulas using ''[]''. This is needed when variables are used in a context where a range of values should be iterated over. A prominent example is the [[.:waypointcalculator|Generate Waypoints]] function
 + 
 +**FIXME** Link to anchor on waypoint calc page as soon as its updated to cover waypoint generation with ranges.
  
 An example for a range expression is ''[0-9]''. This specifies a range with 10 values (the integer values 0 to 9). An example for a range expression is ''[0-9]''. This specifies a range with 10 values (the integer values 0 to 9).
en/cachevariables.txt · Last modified: 2022/11/25 11:58 by lineflyer