![]() |
||
|
||
![]() |
#{expression} or #{expression; format}
Where:
Numerical interpolations probably will be deprecated in the future! Please use the string built-in and the c built-in instead.
The numerical interpolation is used to output the value of a numeric expression. The value of a numeric expression is defined as follows:
if the expression evaluates to a TemplateNumberModel, then it is output in the format specified supplied format specifier.
in all other cases, the evaluation ends with an error.
The format specifier specifies the minimum and the maximum number of fractional digits in the format using syntax mminMmax. For example, m2M5 means "at least two, at most five fractional digits". Either part can be omitted. If only minimum is specified, the maximum is equal to minimum. If only maximum is specified, the minimum is 0.
Unlike ${...}, #{...} never prints grouping separators (like in: 1 000 000 or 100,000,000). This is actually a backward compatibility quirk, but it can be useful when you print numbers in situations like <a href="quertyDatabase?id=#{id}" ...>, where you surely don't want separators. However, starting from FreeMarker 2.3.3 rather use the c built-in instead.
Note, however that a more fine-grained formatting control of numerals can be achieved using the universal interpolation and the string built-in.
![]() |
||
|
||
![]() |
![]() |
|
Page generated: 2006-03-15 13:49:01 GMT | FreeMarker Manual -- For FreeMarker 2.3.6 |