Class num
Number utilities
To get started, place the following line around top of your code.
use amekusa\plz\num;
Methods summary
public static
string
|
#
ordinal( integer $X )
Returns an ordinal number
Returns an ordinal number
Parameters
Returns
string
Example
Demonstration
var_dump( num::ordinal(1) );
var_dump( num::ordinal(2) );
var_dump( num::ordinal(3) );
var_dump( num::ordinal(4) );
var_dump( num::ordinal(11) );
var_dump( num::ordinal(20) );
var_dump( num::ordinal(21) );
var_dump( num::ordinal(-1) );
string(3) "1st"
string(3) "2nd"
string(3) "3rd"
string(3) "4th"
string(4) "11th"
string(4) "20th"
string(4) "21st"
string(4) "-1st"
|
public static
string
|
#
abc( integer $X )
Returns an alphabetic character indexed by $X
Returns an alphabetic character indexed by $X
Parameters
Returns
string
Example
Demonstration
var_dump( num::abc(0) );
var_dump( num::abc(1) );
var_dump( num::abc(2) );
var_dump( num::abc(25) );
var_dump( num::abc(26) );
string(1) "a"
string(1) "b"
string(1) "c"
string(1) "z"
string(1) "a"
|