Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typescript-roman-numbers-converter

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-roman-numbers-converter

TypeScript package that converts arabic number to roman notation

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
552
increased by38%
Maintainers
1
Weekly downloads
 
Created
Source

NPM

Typescript Roman Numbers Converter

NPM

A simple and easy to use Typescript package that converts a given arabic number to roman number format

Installation

$ npm install --save typescript-roman-numbers-converter

How to use it

First of all import the package:

import { toRoman } from "typescript-roman-numbers-converter";

toRoman

Converts the given number into a string that represents the same value in roman notation.


let a: number;
let r: string;

a = 32
r = toRoman(a); //r is now equal to "XXXII"

let a_2 = -12
r = toRoman(a_2); //r is now "" due to limitations

toArabic

Converts the given string into a number that represents the same value in arabic notation.


let a: number;
let r: string;

r = "XXXII"
a = toArabic(a); //a is now equal to 32

isRoman

Returns true if the given string is a valid written roman number


let b = isRoman("MCM"); //b is true
let b_2 = isRoman("ABC"); //b_2 is false

Keywords

FAQs

Package last updated on 29 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc