ESPL: Format statement

Q:  I cannot get the format command to work with a variable enclosed in brackets.  This example gives an error.

vTotalVolume:=13894948
strText:=’The Total Volume was ‘ + Format(‘%12.0n’,[vTotalVolume]);

A:  The parameter needs to be of type ‘real’. The example you gave evaluates to type ‘integer’.   This example works where .0 is appended to the value so it is treated as a ‘real’.

vTotalVolume:=13894948.0
strText:=’The Total Volume was ‘ + Format(‘%12.0n’,[vTotalVolume]);