Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahrefs/melange-numeral
https://github.com/ahrefs/melange-numeral
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/ahrefs/melange-numeral
- Owner: ahrefs
- License: mit
- Created: 2018-06-08T12:28:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-24T13:36:53.000Z (over 1 year ago)
- Last Synced: 2024-12-15T09:05:16.695Z (about 1 month ago)
- Language: Reason
- Size: 20.5 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
# melange-numeral
These are the [Melange](https://melange.re/) bindings for [numeral](http://numeraljs.com/).
🚧 It is not completed, we are adding bindings as we go. Doesn't follow semver at this point. 🚧# Install
Install [opam](https://opam.ocaml.org/) package manager.
Then:
```sh
opam install melange-numeral
```The bindings support the version 2.0.6 of `numeral` npm package, which should be installed separately:
```json
"dependencies": {
"numeral": "2.0.6"
}
```# Setup
Add `melange-numeral` to the `libraries` in your `dune` file:
```lisp
; ...
(libraries melange-numeral)
; ...
```# Usage Example
```reason
module N = Numeral;let myValue = N.make(`Str("11110.49"));
myValue
|. N.add(`Float(123.5))
|. N.subtract(`Int(1234))
|. N.format(~format="0[.]00", ())
|. Js.log; /* 9999.99 */
```# Docs
Check [Numeral documentation](http://numeraljs.com/)
# Alternatives
- [drwlrsn/bs-numeral](https://github.com/drwlrsn/bs-numeral)