Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 518 Bytes

README.md

File metadata and controls

24 lines (15 loc) · 518 Bytes

Decimal

Build Status

Arbitrary-precision Decimal numbers for 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