Convert between Roman numerals and base 10.
Status
Source | Shields |
---|---|
Project | |
Health | |
Repository | |
Activity |
Installation
bower install purescript-roman
Usage
import Data.Roman.Convert (toRoman, fromRoman)
> toRoman 145
"CXLV"
> fromRoman "CXLV"
145
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
]
)
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
]
)
Tests
To run tests:
pulp test
Documentation
This repository's documentation is hosted on Pursuit.
To generate the documentation locally:
pulp docs
Linters
To run linters:
nps lint
Formatters
To run formatters:
nps format
Continuous integration
This repository uses GitHub Actions to lint and test each commit. Each commit should be formatted and its corresponding documentation should be updated.
Versioning
This repository adheres to semantic versioning standards. For more information on semantic versioning visit semver.
Bump2version is used to version and tag changes. For example:
bump2version patch
Changelog
Please read this repository's changelog for details on changes that have been made.
Contributing
Please read this repository's guidelines on contributing for details on the process for submitting pull requests. Moreover, our code of conduct declares our collaboration standards.
Contributors
- Joel Lefkowitz - Initial work
Remarks
Lots of love to the open source community!