{"id":22283488,"url":"https://github.com/y-less/roman-numerals","last_synced_at":"2026-02-05T22:31:50.636Z","repository":{"id":142753099,"uuid":"184601144","full_name":"Y-Less/roman-numerals","owner":"Y-Less","description":"Code using Roman numerals (I, V, X, etc.) instead of silly Arabic ones.","archived":false,"fork":false,"pushed_at":"2022-05-06T17:56:10.000Z","size":706,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T19:52:20.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Pawn","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Y-Less.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-02T15:00:11.000Z","updated_at":"2023-11-17T15:44:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"76b9d575-c2f7-456a-b02a-a5e036b082e8","html_url":"https://github.com/Y-Less/roman-numerals","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Y-Less/roman-numerals","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Y-Less%2Froman-numerals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Y-Less%2Froman-numerals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Y-Less%2Froman-numerals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Y-Less%2Froman-numerals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Y-Less","download_url":"https://codeload.github.com/Y-Less/roman-numerals/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Y-Less%2Froman-numerals/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266424026,"owners_count":23926124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-03T16:40:41.166Z","updated_at":"2026-02-05T22:31:50.611Z","avatar_url":"https://github.com/Y-Less.png","language":"Pawn","funding_links":[],"categories":[],"sub_categories":[],"readme":"# roman-numerals\n\n[![sampctl](https://shields.southcla.ws/badge/sampctl-roman--numerals-2f2f2f.svg?style=for-the-badge)](https://github.com/Y-Less/roman-numerals)\n\n\u003c!--\nShort description of your library, why it's useful, some examples, pictures or\nvideos. Link to your forum release thread too.\n\nRemember: You can use \"forumfmt\" to convert this readme to forum BBCode!\n\nWhat the sections below should be used for:\n\n`## Installation`: Leave this section un-edited unless you have some specific\nadditional installation procedure.\n\n`## Testing`: Whether your library is tested with a simple `main()` and `print`,\nunit-tested, or demonstrated via prompting the player to connect, you should\ninclude some basic information for users to try out your code in some way.\n\nAnd finally, maintaining your version number`:\n\n* Follow [Semantic Versioning](https://semver.org/)\n* When you release a new version, update `VERSION` and `git tag` it\n* Versioning is important for sampctl to use the version control features\n\nHappy Pawning!\n--\u003e\n\n## Installation\n\nSimply install to your project:\n\n```bash\nsampctl package install Y-Less/roman-numerals\n```\n\nInclude in your code and begin using the library:\n\n```pawn\n#include \u003croman-numerals\u003e\n```\n\n## Usage\n\n\u003c!--\nWrite your code documentation or examples here. If your library is documented in\nthe source code, direct users there. If not, list your API and describe it well\nin this section. If your library is passive and has no API, simply omit this\nsection.\n--\u003e\n\nThere are two ways to use this include - prefixed and unprefixed (default):\n\n```pawn\n#define ROMAN_LITERALS\n\n#include \u003croman-numerals\u003e\n#include \u003ca_samp\u003e\n\n#undef MAX_PLAYERS\n#define MAX_PLAYERS (CC)\n\nmain()\n{\n\tfor (new i = nulla; i != XCIV; ++i)\n\t{\n\t\tprintf(\"i + CIII = %d\", i + CIII);\n\t}\n}\n```\n\nPrefixed mode requires `0r` in front of the numbers, but improves compatibility:\n\n```pawn\n#define ROMAN_PREFIX\n#define ROMAN_LITERALS\n\n#include \u003croman-numerals\u003e\n#include \u003ca_samp\u003e\n\n#undef MAX_PLAYERS\n#define MAX_PLAYERS (0rCC)\n\nmain()\n{\n\tfor (new i = 0rN; i != 0rXCIV; ++i)\n\t{\n\t\tprintf(\"i + 0rCIII = %d\", i + 0rCIII);\n\t}\n}\n```\n\nNote that there's no Roman numeral for zero, use `nulla` or `0rN` instead.  `ROMAN_LITERALS` includes the defines to make the numbers work (since there are several thousand of them).  Without this you can't use the literals, but can still use the two functions for converting to and from strings:\n\n```pawn\n// Remove this for much faster compiling.\n//#define ROMAN_LITERALS\n\n#include \u003ca_samp\u003e\n#include \"roman-numerals.inc\"\n\nmain()\n{\n\tprintf(\"%d\", FromRomanNumeral(\"MCCVIIII\"))\n\tnew str[32];\n\n\tToRomanNumeral(54, str, .subtractive = false);\n\tprintf(str); // LIIII\n\n\tToRomanNumeral(54, str, .subtractive = true);\n\tprintf(str); // LIV\n}\n```\n\n## Numbers\n\nContrary to popular belief, there is no fixed standard on how to write certain numbers.  These are all valid versions of `449`:\n\n```\nCCCCXXXXVIIII\nCCCCXLVIIII\nCDXXXXVIIII\nCCCCXXXXIX\nCDXLVIIII\nCDXXXXIX\nCCCCXLIX\nCDXLVIII\nCCCCIL\nCDIL\n```\n\nNormally it is only `4` and `9` that has this ambiguity, so this library handles every variant of those.  There is some evidence that any number can use this scheme, so `8` could be `IIX`, but these extra extended numbers are not yet handled.  Unsurprisingly, Tom Scott has a relevant video:\n\nhttps://www.youtube.com/watch?v=jMxoGqsmk5Y\n\nThere is also no standard for numbers over 3000, since there is no symbol for 5000.  Two methods are to simply use more `M`s, or to add a bar over numbers indicating `* 1000`.  This library uses the former, up to pawn symbol limits (31 characters).  Thus the largest possible number you can represent without modifying the compiler is in unprefixed mode and is `31000` (`MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM`).\n\n## Testing\n\n\u003c!--\nDepending on whether your package is tested via in-game \"demo tests\" or\ny_testing unit-tests, you should indicate to readers what to expect below here.\n--\u003e\n\nTo test, simply run the package:\n\n```bash\nsampctl package run\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy-less%2Froman-numerals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fy-less%2Froman-numerals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy-less%2Froman-numerals/lists"}