NumberHelper

Type
Class
Namespace
Craft
Inherits
Craft\NumberHelper
Since
1.0

Class NumberHelper

See also http://craftcms.com

View source (opens new window)

# Public Methods

Method Description
lowerAlpha() Returns the lowercase alphabetic version of a number
lowerRoman() Returns the lowercase roman numeral version of a number
makeNumeric() Returns the numeric value of a variable.
upperAlpha() Returns the uppercase alphabetic version of a number
upperRoman() Returns the uppercase roman numeral version of a number
word() Returns the "word" version of a number

# lowerAlpha()

Returns the lowercase alphabetic version of a number

View source (opens new window)

Arguments

Returns

string (opens new window) – The alphabetic version of the number

Signature

public static string lowerAlpha ( $num )

# lowerRoman()

Returns the lowercase roman numeral version of a number

View source (opens new window)

Arguments

Returns

string (opens new window) – The roman numeral version of the number

Signature

public static string lowerRoman ( $num )

# makeNumeric()

Returns the numeric value of a variable. If the variable is an object with a __toString() method, the numeric value of its string representation will be returned.

View source (opens new window)

Arguments

  • $var (mixed)

Returns

mixed

Signature

public static mixed makeNumeric ( $var )

# upperAlpha()

Returns the uppercase alphabetic version of a number

View source (opens new window)

Arguments

Returns

string (opens new window) – The alphabetic version of the number

Signature

public static string upperAlpha ( $num )

# upperRoman()

Returns the uppercase roman numeral version of a number

View source (opens new window)

Arguments

Returns

string (opens new window) – The roman numeral version of the number

Signature

public static string upperRoman ( $num )

# word()

Returns the "word" version of a number

View source (opens new window)

Arguments

Returns

string (opens new window) – The number word, or the original number if it's >= 10

Signature

public static string word ( $num )