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 +