SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: How to convert?

  1. #1
    SitePoint Zealot santanu's Avatar
    Join Date
    Oct 2003
    Location
    india
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation How to convert?

    I want to convert from roman number to english number. I mean to say is their any function in php which will convert (v,vi,vii etc.) to (5,6,7 etc.) ? If not can you tell me how can be done in php? I want a script or function which will convert "roll number x" to "roll number 10".

    wating for some good suggestion.

    Thank you,
    Santanu.

  2. #2
    Who Me? JeremyL's Avatar
    Join Date
    Dec 1999
    Location
    Dallas, TX
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't know of a native one but here if you like pear

    http://php4you.kiev.ua/pear/Numbers_Roman.html

  3. #3
    SitePoint Zealot santanu's Avatar
    Join Date
    Oct 2003
    Location
    india
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Though I am able to see the page where the conversion occours but the code or script to convert isn't their.

    Anybody their to help me out?
    Last edited by santanu; Nov 1, 2003 at 06:34.

  4. #4
    SitePoint Zealot santanu's Avatar
    Join Date
    Oct 2003
    Location
    india
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Quote Originally Posted by JeremyL
    Don't know of a native one but here if you like pear

    http://php4you.kiev.ua/pear/Numbers_Roman.html
    Though I am able to see the page where the conversion occours but the code or script to convert isn't their.

    Anybody their to help me out?

  5. #5
    SitePoint Addict RapidGaming's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    204
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Couldn't you just use ereg_replace?

    http://uk.php.net/manual/en/function.ereg-replace.php

  6. #6
    SitePoint Zealot santanu's Avatar
    Join Date
    Oct 2003
    Location
    india
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No I don't want to use the "ereg_replace()" because if I use this function then I have to fix lots of english numbers against roman numbers and for the time being I want to avoid it.

  7. #7
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://pear.php.net/package/Numbers_Roman

    I hate these sorts of short posts with just a link but I really don't have much else to say. Perhaps because I think replicating this class would be a total waste of time. :-)
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •