This is the old documentation center for eZ Publish 4. We are currently migrating the eZ Publish documentation to http://confluence.ez.no the eZ Publish 5 documentation platform. Documentation for the eZ Publish legacy components are still located on this site, as well as all documentation for earlier releases.

int

Summary

Converts the input parameter to an integer.

Usage

input|int()

Returns

An integer representation of the input parameter.

Description

This operator attempts to convert the input parameter to an integer. It will return the converted value as an integer. If the operator is unable to do the conversion, it will return the value of zero (0).

Examples

Example 1

{def $number='57'}
Value: {$number|int()}

Converts the string "57" and returns it as an integer. The following output will be produced: "Value: 57".

Example 2

{def $number='fiftyseven'}
Value: {$number|int()}

The following output will be produced: "Value: 0".

Balazs Halasy (02/06/2004 5:00 pm)

Balazs Halasy (06/05/2005 9:20 am)


Comments

  • what if number is heximal?

    i want to convert to string "0f9A" to integer.
    • Re: what if number is heximal?

      what is heximal and how to compute it.