An open API service indexing awesome lists of open source software.

https://github.com/akaustav/roman-number-utils

Utility methods to convert natural numbers to roman numbers and vice-versa.
https://github.com/akaustav/roman-number-utils

deno roman roman-numerals typescript

Last synced: 4 months ago
JSON representation

Utility methods to convert natural numbers to roman numbers and vice-versa.

Awesome Lists containing this project

README

          

# roman-number-utils

Utility methods to convert natural numbers to roman numbers and vice-versa.

## Natural to Roman Number Example

```typescript
import { naturalToRoman } from 'https://deno.land/x/roman_number_utils@1.0.1/mod.ts';

const natural = 54;
const roman = naturalToRoman(natural);

console.log(roman); // expected output: LIV
```

## Roman to Natural Number Example

```typescript
import { romanToNatural } from 'https://deno.land/x/roman_number_utils@1.0.1/mod.ts';

const roman = 'MMXX';
const natural = romanToNatural(roman);

console.log(natural); // expected output: 2020
```

## Execute Examples

```shell
deno run https://deno.land/x/roman_number_utils/examples/example-natural-to-roman.ts
deno run https://deno.land/x/roman_number_utils/examples/example-roman-to-natural.ts
```

## License

The [MIT License](LICENSE)