Skip to content

Commit 3e3826b

Browse files
authored
Update functions_xls.md
- Minor edits
1 parent c99e491 commit 3e3826b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

source/functions_xls.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The following functions are some of the most frequently used in XLSForm. They he
2020
| `count-selected(${question_name})` | Returns the number of options selected in a `select_multiple` question. |
2121
| `coalesce(${question1}, ${question2})` | Returns the first non-empty value of the two arguments. Returns an empty string if both are empty or non-existent. |
2222
| `jr:choice-name(choice_name, '${question_name}')` | Returns the label value, in the active language, associated with the `choice_name` in the list of choices for a select type question. To retrieve the label of whichever response was selected, use `jr:choice-name(${question_name}, '${question_name}')`. |
23-
| `selected-at(${question_name}, n)` | Returns a selected choice in a `select_multiple` question at the nth position. For example, `selected-at(${question_name}, 2)` returns the second choice selected in a `select_multiple` question. |
23+
| `selected-at(${question_name}, n)` | Returns a selected choice in a `select_multiple` question at the n<sup>th</sup> position. For example, `selected-at(${question_name}, 2)` returns the second choice selected in a `select_multiple` question. |
2424
| `once(expression)` | Evaluates an expression only once (e.g., to ensure a random number is only generated once, or to store the first value entered for a question even if the response is changed later). |
2525
| `instance('list_name')/root/item[name = ${question}]/column_name` | Retrieves a value from the choices sheet. Searches the choice list named `list_name`, finds the row where the choice `name` matches the response to `${question}`, and returns the value from the column specified as `column_name`. |
2626

@@ -34,12 +34,11 @@ The following functions are used to perform mathematical operations or transform
3434
| `round(number, places)` | Rounds a decimal value to a predetermined number of decimal places. |
3535
| `pow(number, power)` | Calculates the power of a number. |
3636
| `number(x)` | Converts x (a string or boolean expression) to a number value. |
37-
| `log(number)` | Returns the natural log of a number. |
38-
| `log10(number)` | Returns the base-10 log of a number. |
37+
| `log(number)` <br> `log10(number)` | Returns the natural log or base-10 log of a number. |
3938
| `abs(number)` | Returns the absolute value of a number. |
4039
| `sin(number)` <br> `asin(number)` <br> `cos(number)` <br> `acos(number)` <br> `tan(number)` <br> `atan(number)` | Returns the sine/arc sine, cosine/arc cosine, or tangent/arc tangent of a number. |
4140
| `sqrt(number)` | Returns the square root of a number. |
42-
| `exp(x)` <br> `exp10(x)` | Returns e^x. |
41+
| `exp(x)` <br> `exp10(x)` | Returns e^x or 10^x. |
4342
| `pi()` | Returns an approximation of the mathematical constant π. |
4443

4544
<p class="note">
@@ -73,8 +72,8 @@ The following functions are used to record, format, and calculate date and time
7372
| `today()` | Returns the current date without a time component. |
7473
| `now()` | Returns the current date and time in ISO 8601 format, including the timezone. |
7574
| `date('YYYY-MM-DD')` | Forces dates into the correct date format (especially for dates before 1970). |
76-
| `format-date(date, format)` | Returns date as a string formatted as defined by <code>format</code>. Common formats include: <ul><li><code>%Y</code>: 4-digit year</li><li><code>%y</code>: 2-digit year</li><li><code>%m</code>: 0-padded month</li><li><code>%n</code>: numeric month</li><li><code>%b</code>: short text month (Jan, Feb, Mar…)</li><li><code>%d</code>: 0-padded day of month</li><li><code>%e</code>: day of month</li><li><code>%a</code>: short text day (Sun, Mon, Tue…)</li></ul> |
77-
| `format-date-time(dateTime, format)` | Returns dateTime as a string formatted as defined by <code>format</code>. Common formats include: <ul><li><code>%H</code>: 0-padded hour (24-hr time)</li><li><code>%h</code>: hour (24-hr time)</li><li><code>%M</code>: 0-padded minute</li><li><code>%S</code>: 0-padded second</li><li><code>%3</code>: 0-padded millisecond ticks</li></ul> |
75+
| `format-date(date, format)` | Returns date as a string formatted as defined by <code>format</code>. Common formats include: <ul><li><code>%Y</code>: 4-digit year</li><li><code>%y</code>: 2-digit year</li><li><code>%m</code>: 0-padded month</li><li><code>%n</code>: numeric month</li><li><code>%b</code>: short text month (Jan, Feb, Mar…)</li><li><code>%d</code>: 0-padded day of month</li><li><code>%e</code>: day of month</li><li><code>%a</code>: short text day (Sun, Mon, Tue…).</li></ul> |
76+
| `format-date-time(dateTime, format)` | Returns dateTime as a string formatted as defined by <code>format</code>. Common formats include: <ul><li><code>%H</code>: 0-padded hour (24-hr time)</li><li><code>%h</code>: hour (24-hr time)</li><li><code>%M</code>: 0-padded minute</li><li><code>%S</code>: 0-padded second</li><li><code>%3</code>: 0-padded millisecond ticks.</li></ul> |
7877

7978

8079
## Functions to manipulate GPS data

0 commit comments

Comments
 (0)