Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Routine to convert Roman / Arabic numbers

Routine to convert Roman / Arabic numbers

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stlan
    wrote on last edited by
    #1

    Hi there, Does anybody knows where I cound find a routine that would convert integer values into roman numbers and vice-versa. Something like : INT i = RomanToArabic(_T("XII")); ASSERT(i == 12); CString s(ArabicToRoman(24)); ASSERT(s.CompareNoCase(_T("XXIV")) == 0);

    D 1 Reply Last reply
    0
    • S Stlan

      Hi there, Does anybody knows where I cound find a routine that would convert integer values into roman numbers and vice-versa. Something like : INT i = RomanToArabic(_T("XII")); ASSERT(i == 12); CString s(ArabicToRoman(24)); ASSERT(s.CompareNoCase(_T("XXIV")) == 0);

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      It's easy enough to create such a function. Here is a site with JavaScript that can easily be converted to C. Others can be found here.


      "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

      S 1 Reply Last reply
      0
      • D David Crow

        It's easy enough to create such a function. Here is a site with JavaScript that can easily be converted to C. Others can be found here.


        "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

        S Offline
        S Offline
        Stlan
        wrote on last edited by
        #3

        Indeed, the algorithm is not so complicated as I first believed. Thanks David.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups