setNumber
A logic command that sets a variable with a Number value into the variable context.
Attributes
var | ||
---|---|---|
Required | Value type | EL-evaluated |
Yes | String | No |
Defines the name of the variable that will hold the Number. |
value | ||
---|---|---|
Required | Value type | EL-evaluated |
No | Any | Depends on the |
Defines the Number value this command is setting. If the resolved value is a Number, that Number is used as is. If the resolved value is a String, it is parsed into the Number the String represents (an error occurs if the String cannot be parsed). If the resolved value is of any other kind, an error is produced. If undefined or the resolved value is |
expressionType | ||
---|---|---|
Required | Value type | EL-evaluated |
No | String | Yes |
Defines how the value expression of the
If this attribute is undefined, the value of "el" is used. |
Examples
Compared to set, the setNumber
command allows for some more ways to create Numbers. All the following produce a Number:
<setNumber var="num1" value="${255}"><setNumber var="num2" value="${25 + 70}"><setNumber var="num3" value="73"><setNumber var="num4">