Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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)