is_numeric

Summary

Returns true if the target variable is a number.

Usage

$input|is_numeric( test )

Parameters

NameTypeDescriptionRequired
test any Variable to check. only if input is omitted

Returns

True or false, see description for details.

Description

This operator simply checks the input or the supplied parameter. The operator returns true if the input or the first parameter is a number or a numberic string (a string consisting of numbers). If both input and parameter are supplied, the it is the parameter that will be evaluated.

Examples

{"2506"|is_numeric}

The example above returns true.

{let my_variable=256}

{$my_variable|is_numeric( "Hahaha" }

{/let}

The example above returns false.

{let my_variable=256}

{"Hehe"|is_object( $my_variable) }

{/let}

The example above returns true.

Comments

log in or create a user account to comment.

Contents

Reference

Database diagram
Template operators
    PDF
    Arrays
    Data extraction
    Formatting
    Images
    Logic
    Mathematics
    Miscellaneous
    Strings
    URLs
    Variables
       float
       get_class
       get_type
       count
       int
       is_array
       is_boolean
       is_class
       is_float
       is_integer
       is_null
       is_numeric
       is_object
       is_set
       is_string
       is_unset
Template functions
Data fetching
Modules
XML tags


Created

05/02/2004
1:35:15 pm
by Balazs Halasy

Last updated

06/02/2004
3:26:24 pm
by Balazs Halasy

Authors

Balazs Halasy



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.