Template Engine language reference > General functions > toDouble()

toDouble()
The toDouble() function converts a string or int to a double floating point. This is useful, for example, when you need to perform calculations on field values retrieved from the Message. Field values are retrieved as strings, and if you want to perform calculations on these values you must first convert the strings to either int (see toInt() below) or double floating point.
In both examples below, the value of $message.total is "1356.75".
Example 37
Template
#set($a=$message.total.toDouble())
#set($b=$a+110.36)
$b
Output
1467.11
 
Example 38
Template
#set($a=$message.total)
#set($b=$a+110.36)
Output
1356.75110.36
 
OpenText StreamServe 5.6.2 Updated: 2018-01-26