wkaluza / decimal

Arbitrary Precision Decimals in Elm

Home Page:http://package.elm-lang.org/packages/prikhi/decimal/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Arbitrary Precision Decimals in Elm

http://package.elm-lang.org/packages/prikhi/decimal/latest

License:MIT License


Languages

Language:Elm 100.0%