Skip to content

Commit

Permalink
Remove unnecessary functions from currency examples
Browse files Browse the repository at this point in the history
Can now just use Quantity.round, Quantity.floor, Quantity.ceiling
  • Loading branch information
ianmackenzie committed Sep 20, 2018
1 parent 6b58806 commit 740a534
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
18 changes: 0 additions & 18 deletions examples/Eur.elm
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ module Eur exposing
, euros
, inCents
, inEuros
, roundDownToNearestCent
, roundToNearestCent
, roundUpToNearestCent
)

import Quantity exposing (Quantity(..))
Expand Down Expand Up @@ -40,18 +37,3 @@ euros numEuros =
inEuros : Quantity Float Cents -> Float
inEuros (Quantity numCents) =
numCents / 100


roundToNearestCent : Quantity Float Cents -> Quantity Int Cents
roundToNearestCent (Quantity numCents) =
Quantity (round numCents)


roundDownToNearestCent : Quantity Float Cents -> Quantity Int Cents
roundDownToNearestCent (Quantity numCents) =
Quantity (floor numCents)


roundUpToNearestCent : Quantity Float Cents -> Quantity Int Cents
roundUpToNearestCent (Quantity numCents) =
Quantity (ceiling numCents)
18 changes: 0 additions & 18 deletions examples/Usd.elm
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ module Usd exposing
, dollars
, inCents
, inDollars
, roundDownToNearestCent
, roundToNearestCent
, roundUpToNearestCent
)

import Quantity exposing (Quantity(..))
Expand Down Expand Up @@ -40,18 +37,3 @@ dollars numDollars =
inDollars : Quantity Float Cents -> Float
inDollars (Quantity numCents) =
numCents / 100


roundToNearestCent : Quantity Float Cents -> Quantity Int Cents
roundToNearestCent (Quantity numCents) =
Quantity (round numCents)


roundDownToNearestCent : Quantity Float Cents -> Quantity Int Cents
roundDownToNearestCent (Quantity numCents) =
Quantity (floor numCents)


roundUpToNearestCent : Quantity Float Cents -> Quantity Int Cents
roundUpToNearestCent (Quantity numCents) =
Quantity (ceiling numCents)

0 comments on commit 740a534

Please sign in to comment.