Misc/Numeralo.php
/**
	* Converts natural numbers to Roman numerals.
	*
	* @static
	* @param int|string $number a number or numeric string less than 3,999,999
	* @throws \InvalidArgumentException if the provided $number argument is not numeric or greater than 3,999,999.
	* @return string Roman numeral equivalent	
	*/
Converts natural numbers to Roman numerals.
@static
@param int|string $number a number or numeric string less than 3,999,999
@throws \InvalidArgumentException if the provided $number argument is not numeric or greater than 3,999,999.
@return string Roman numeral equivalent
Converts natural numbers to Roman numerals . @static @param int|string $number a number or numeric string less than 3 999 999 @throws \ InvalidArgumentException if the provided $number argument is not numeric or greater than 3 999 999 . @return string Roman numeral equivalent
public static function number_to_numerals($number) {
		if(!is_numeric($number))
			throw new \InvalidArgumentException('Only numbers allowed');
		if($number > 3999999)
			throw new \InvalidArgumentException('Number cannot be greater than 3,999,999');
		$number = (int) $number;
		$numerals = '';
		$number_string = strrev((string) $number);
		$length = strlen($number_string);
		for($i = 0; $i < $length; $i++) {
			$char = $number_string[$i];
			$num_map = self::$NUMERALS_BY_PLACE_VALUE[$i];
			$numerals = str_replace(self::$NOTATION, $num_map, self::$NUMBER_TO_NOTATION[$char]) . $numerals;
		}
		return $numerals;	
	}
public static function number_to_numerals ( $ number ) { if ( ! is_numeric ( $ number ) ) throw new \ InvalidArgumentException ( 'Only numbers allowed' ) ; if ( $ number > 3999999 ) throw new \ InvalidArgumentException ( 'Number cannot be greater than 3,999,999' ) ; $ number = ( int ) $ number ; $ numerals = '' ; $ number_string = strrev ( ( string ) $ number ) ; $ length = strlen ( $ number_string ) ; for ( $ i = 0 ; $ i < $ length ; $ i ++ ) { $ char = $ number_string [ $ i ] ; $ num_map = self :: $ NUMERALS_BY_PLACE_VALUE [ $ i ] ; $ numerals = str_replace ( self :: $ NOTATION , $ num_map , self :: $ NUMBER_TO_NOTATION [ $ char ] ) . $ numerals ; } return $ numerals ; }
Converts natural numbers to Roman numerals.
Converts natural numbers to Roman numerals .
//floats are not supported