input|dec( value )
Name | Type | Description | Required |
---|---|---|---|
value | number | The value that should be decremented. | Only if the input parameter is omitted. |
This operator decrements either the input or the "value" parameter with one and returns the result as an integer. If both are provided, it is the "value" parameter that will be used. Please note that this operator can not be used directly to decrement the value of a variable (please refer to the last example).
{256|dec}
or
{dec( 256 )}
The following output will be produced: 255.
{200|dec( 250 )}
The following output will be produced: 249.
{def $i=256} {set $i=dec( $i )} {$i}
This example demonstrates how the value of a variable can be decremented using the "set" and the "dec" operators. The following output will be produced: "255".
Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.