From 066a6511416748aa92925b920e98d4f4eb4938fa Mon Sep 17 00:00:00 2001 From: Denis Tereshkin Date: Mon, 16 Oct 2017 18:23:23 +0700 Subject: [PATCH] Price: Show instance --- src/ATrade/Price.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ATrade/Price.hs b/src/ATrade/Price.hs index 85fd107..cceae45 100644 --- a/src/ATrade/Price.hs +++ b/src/ATrade/Price.hs @@ -18,7 +18,7 @@ import Data.Scientific data Price = Price { priceQuants :: !Int64 -} deriving (Eq, Show, Ord) +} deriving (Eq, Ord) giga :: Int64 giga = 1000000000 @@ -74,3 +74,7 @@ instance Real Price where instance Fractional Price where fromRational a = fromInteger (numerator a) / fromInteger (denominator a) a / b = fromDouble $ toDouble a / toDouble b + +instance Show Price where + show = show . toDouble +