Number ​
- Type
- Class
- Namespace
- craft\helpers
- Inherits
- craft\helpers\Number
- Since
- 3.0.0
Class Number
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
Arguments ​
$num
(integer) – The number
Returns ​
string – The alphabetic version of the number
lowerRoman()
​
Returns the lowercase roman numeral version of a number
Arguments ​
$num
(integer) – The number
Returns ​
string – The roman numeral version of the number
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.
Arguments ​
$var
(mixed
)
Returns ​
mixed
upperAlpha()
​
Returns the uppercase alphabetic version of a number
Arguments ​
$num
(integer) – The number
Returns ​
string – The alphabetic version of the number
upperRoman()
​
Returns the uppercase roman numeral version of a number
Arguments ​
$num
(integer) – The number
Returns ​
string – The roman numeral version of the number
word()
​
Returns the "word" version of a number
Arguments ​
$num
(integer) – The number
Returns ​
string – The number word, or the original number if it's >= 10