Skip to content

bonega/decimal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages

  • Elm 100.0%