Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prikhi/decimal
Arbitrary Precision Decimals in Elm
https://github.com/prikhi/decimal
decimal elm
Last synced: 3 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 (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-07T20:24:52.000Z (over 4 years ago)
- Last Synced: 2024-04-16T06:58:51.345Z (9 months ago)
- Topics: decimal, elm
- Language: Elm
- Homepage: http://package.elm-lang.org/packages/prikhi/decimal/latest
- Size: 25.4 KB
- Stars: 8
- Watchers: 3
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Decimal
[![Build Status](https://travis-ci.org/prikhi/decimal.svg?branch=master)](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)