Number Format by Value
In the field:
{
expression
Format
format
} where
expression
is a whole number or a decimal number, the format
text may be a series of alternative formats separated by the vertical bar character. For example, the format text: "<0=digits|1-9=wth|integer=0,0|0.00"
represents a series of alternative formats:
"<0=digits"
"1-9=wth"
"integer=0,0"
"0.00"
Each alternative format takes the general form:
test=appliedformat
In a series of alternative formats, the
appliedformat
that is chosen corresponds to the first satisfied test
for the value
of the expression
. The series of alternative formats should be terminated by an unconditional format that is applied whenever all of the preceding tests are unsatisfied.
Value Tests
Test | Logic |
|---|---|
number | value = number |
lowernumber -uppernumber | value >= lowernumber and value <= uppernumber |
> lowernumber | value > lowernumber |
>= lowernumber | value >= lowernumber |
<uppernumber | value < uppernumber |
<=uppernumber | value <= uppernumber |
integer | value is a whole number |
float | value is a decimal number |
Example
The following table contains the return texts for the evaluation of the expression:
Text(
value
, "<0=digits|1-9=wth|integer=0,0|0.00" ) Value | Return |
|---|---|
-1003 | "-1003" |
3 | "Third" |
1003 | "1,003" |
100300.4 | "100300.40" |