Skip to content

A minimal TypeScript package for converting numbers into Roman numerals, including support for large numbers with overlines. 20 -> XX

License

Notifications You must be signed in to change notification settings

Charmingdc/Romanify

Repository files navigation

Romanify 🏛️

A high-precision TypeScript utility for converting integers into Roman numerals. Unlike standard converters, Romanify supports the Vinculum system (overline notation), allowing it to accurately represent numbers far exceeding the traditional 3,999 limit.

Features

  • Extended Range: Supports numbers from 1 to 3,999,999 using proper Unicode overline characters.
  • Type Safety: Built entirely with TypeScript for robust type checking and IDE autocompletion.
  • Lightweight: Zero external dependencies, ensuring a minimal footprint in your project.
  • Input Validation: Includes built-in checks to ensure values are positive integers.

Installation

Follow these steps to set up the project locally for development or integration:

  1. Clone the Repository

    git clone git@github.com:Charmingdc/Romanify
  2. Navigate to the Directory

    cd Romanify
  3. Install Dependencies

    npm install
  4. Build the Project

    npm run build

Usage

You can import the romanize function directly into your TypeScript or JavaScript project.

import { romanize } from "@charmingdc/romanify";

// Standard conversion
console.log(romanize(2024)); // Output: MMXXIV

// Large number conversion (using vinculum)
console.log(romanize(5000)); // Output: V̅

// Complex large numbers
console.log(romanize(4500)); // Output: I̅V̅D

Running Tests

To ensure the conversion logic remains accurate across all numeral mappings:

npm test

Technologies Used

Technology Purpose Link
TypeScript Language & Type Safety typescriptlang.org
Node.js Runtime Environment nodejs.org
NPM Package Management npmjs.com

Contributing

Contributions are welcome to help improve the logic or performance of the converter.

  • 🍴 Fork the repository.
  • 🌿 Create a new branch for your feature or bug fix.
  • 🧪 Ensure all tests pass before submitting a pull request.
  • 📝 Document any changes in the function signatures.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author Info

Adebayo Muis (Charming Dc)


TypeScript NodeJS Build Status

Readme was generated by Dokugen

About

A minimal TypeScript package for converting numbers into Roman numerals, including support for large numbers with overlines. 20 -> XX

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published