CodeIgniter Forums
How to convert integer to Roman numerals? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How to convert integer to Roman numerals? (/showthread.php?tid=55290)



How to convert integer to Roman numerals? - El Forum - 10-18-2012

[eluser]Sanjay Sarvaiya[/eluser]
Hello friends,

I want to convert Integer value to Roman Numerals.
Actually I want to convert month number to Roman numerals.
any help appreciates
Thans.


How to convert integer to Roman numerals? - El Forum - 10-18-2012

[eluser]solid9[/eluser]
Try to make an array map.

$roman = array(
1 => "I",
2 => "II",
3 => "III",
4 => "IV",
5 => "V"
);

It's just a hint above, just use your imagination.



How to convert integer to Roman numerals? - El Forum - 10-18-2012

[eluser]Aken[/eluser]
If you only need roman numerals for that purpose, then just use an array reference like solid9 said.

If you want to actually calculate roman numerals for pretty much any number, then search around online - there's gotta be a function written for it by someone already.


How to convert integer to Roman numerals? - El Forum - 10-19-2012

[eluser]Sanjay Sarvaiya[/eluser]
Thanks for your help.

I have done with the help of
http://www.php.net/manual/en/function.base-convert.php#92960