/decimal

Arbitrary Precision Decimals in Elm

Primary LanguageElmMIT LicenseMIT

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