https://github.com/prikhi/decimal
Arbitrary Precision Decimals in Elm
https://github.com/prikhi/decimal
decimal elm
Last synced: 8 months ago
JSON representation
Arbitrary Precision Decimals in Elm
- Host: GitHub
- URL: https://github.com/prikhi/decimal
- Owner: prikhi
- License: mit
- Created: 2017-09-18T04:56:50.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-10-07T20:24:52.000Z (over 5 years ago)
- Last Synced: 2025-02-02T01:03:02.629Z (over 1 year ago)
- Topics: decimal, elm
- Language: Elm
- Homepage: http://package.elm-lang.org/packages/prikhi/decimal/latest
- Size: 25.4 KB
- Stars: 10
- Watchers: 3
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Decimal
[](https://travis-ci.org/prikhi/decimal)
Arbitrary-precision Decimal numbers for Elm.
```elm
import Decimal exposing (Decimal)
centsToDecimalString : Int -> String
centsToDecimalString totalCents =
Decimal.fromInt totalCents
|> Decimal.mul (Decimal.intWithExponent 1 -2)
|> Decimal.toString
|> ((++) "$")
```
# License
MIT
Forked from [javcasas' elm-decimal](https://github.com/javcasas/elm-decimal)