previousアラビア数字からローマ数字への変換 (Previous) (Next) PEARnext

View this page in Last updated: Sun, 21 Jun 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

ローマ数字からアラビア数字への変換

静的メソッド toNumber を使用すると、 XLII のようなローマ数字を 42 のようなアラビア数字に変換することができます。 1000 より大きい数字を扱う際には、文字の前にアンダースコアを付加します。

ローマ数字からアラビア数字への変換テーブル
ローマ数字 アラビア数字
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
S, _V 5000
R, _X 10 000
P, _L 50 000
Q, _C 100 000
O, _D 500 000
N, _M 1 000 000

ローマ数字からアラビア数字への変換

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

echo 
Numbers_Roman::toNumber('XLII');
// 結果は 42 となります
?>
previousアラビア数字からローマ数字への変換 (Previous) (Next) PEARnext

Download Documentation Last updated: Sun, 21 Jun 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.