Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 22043 программиста и 1263 робота. Сейчас ищут 334 программиста ...

Converting Arabic to Roman Numerals

Вернуться к: Numbers_Roman

Both class methods are static; you do not need to instantiate an object.

The static method toNumeral does exactly this. It can be used for numbers from 1 to 5 999 999. Using it to convert higher numbers works, but does not produce historically correct results.

The second parameter $uppercase determines if the letters should be UPPERCASE (default) or not. Parameter number 3 sets if HTML code for overscores shall be generated; this is necessary for numbers greater than 3999. If the parameter is set to false, letters will be prefixed with an underscore _.

Converting Arabic numbers to Roman numerals

<?php
require_once 'Numbers/Roman.php';

echo 
Numbers_Roman::toNumeral(23);
//returns: XXIII

echo Numbers_Roman::toNumeral(23false);
//returns: xxiii
?>


Вернуться к: Numbers_Roman

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware