Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joellefkowitz/roman
Convert between Roman numerals and base 10.
https://github.com/joellefkowitz/roman
convert numerals roman
Last synced: 11 days ago
JSON representation
Convert between Roman numerals and base 10.
- Host: GitHub
- URL: https://github.com/joellefkowitz/roman
- Owner: JoelLefkowitz
- License: mit
- Created: 2021-05-29T13:42:40.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-27T18:56:14.000Z (4 months ago)
- Last Synced: 2024-10-05T21:41:51.597Z (about 1 month ago)
- Topics: convert, numerals, roman
- Language: PureScript
- Size: 383 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Roman
Convert between Roman numerals and base 10.
![Review](https://img.shields.io/github/actions/workflow/status/JoelLefkowitz/roman/review.yml)
![Version](https://pursuit.purescript.org/packages/purescript-roman/badge)
![Quality](https://img.shields.io/codacy/grade/ec61f81349714facb1a2d53d317c77d6)## Installing
```bash
spago install roman
```## Documentation
Documentation and more detailed examples are hosted on [Pursuit](https://pursuit.purescript.org/packages/purescript-roman).
## Usage
```purs
import Data.Roman.Convert (toRoman, fromRoman)> toRoman 145
"CXLV"> fromRoman "CXLV"
145
``````purs
import Data.Map (fromFoldable)
import Data.Tuple (Tuple(..))
import Data.Roman.Symbols (symbolsTable)> symbolsTable
SymbolsTable
( fromFoldable
[ Tuple "I" 1
, Tuple "IV" 4
, Tuple "V" 5
, Tuple "IX" 9
, Tuple "X" 10
, Tuple "XL" 40
, Tuple "L" 50
, Tuple "XC" 90
, Tuple "C" 100
, Tuple "CD" 400
, Tuple "D" 500
, Tuple "CM" 900
, Tuple "M" 1000
]
)
``````purs
import Data.Roman.Generate (generateSymbolsTable)> generateSymbolsTable ["I", "V", "X", "L", "C", "D", "M", "V*", "X*"]
SymbolsTable
( fromFoldable
[ Tuple "I" 1
, Tuple "IV" 4
, Tuple "V" 5
, Tuple "IX" 9
, Tuple "X" 10
, Tuple "XL" 40
, Tuple "L" 50
, Tuple "XC" 90
, Tuple "C" 100
, Tuple "CD" 400
, Tuple "D" 500
, Tuple "CM" 900
, Tuple "M" 1000
, Tuple "MV*" 4000
, Tuple "V*" 5000
, Tuple "MX*" 9000
, Tuple "X*" 10000
]
)
```## Tooling
### Dependencies
To install dependencies:
```bash
yarn install
yarn spago install
```### Tests
To run tests:
```bash
yarn spago test
```### Documentation
To generate the documentation locally:
```bash
yarn spago docs
```### Linters
To run linters:
```bash
yarn lint
```### Formatters
To run formatters:
```bash
yarn format
```## Contributing
Please read this repository's [Code of Conduct](CODE_OF_CONDUCT.md) which outlines our collaboration standards and the [Changelog](CHANGELOG.md) for details on breaking changes that have been made.
This repository adheres to semantic versioning standards. For more information on semantic versioning visit [SemVer](https://semver.org).
Bump2version is used to version and tag changes. For example:
```bash
bump2version patch
```### Contributors
- [Joel Lefkowitz](https://github.com/joellefkowitz) - Initial work
## Remarks
Lots of love to the open source community!