ibexa

Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.

round

Summary

Returns a rounded version of the input or a parameter value.

Usage

input|round( value )

Parameters

NameTypeDescriptionRequired
value number The number that should be rounded off. Only if the input parameter is omitted.

Returns

A rounded off version of the provided value (an integer or float).

Description

This operator rounds off the value that was specified using either the input or the "value" parameter. If both are provided, it is the "value" parameter that will be used. The operator returns the rounded off value.

Examples

Example 1

{15.7|round}

or

{round( 15.7 )}

The following output will be produced: "16".

Example 2

{8.4|round( 9.7 )}

The following output will be produced: "10".

Balazs Halasy (05/02/2004 10:48 am)

Balazs Halasy (04/05/2005 2:20 pm)


Comments

  • No parameter to set the number of digits after the ,

    If you want to have it with 2 digits precision :
    {def $average=div(ceil(div(mul($total,100),$totalvote)),100)}