@@ -36,8 +36,13 @@ instance rightModuleDiscrete :: RightModule (Discrete c) Int where
36 mmulR (Discrete a) b = Discrete (a * b)
36 mmulR (Discrete a) b = Discrete (a * b)
38-- | Show the discrete value with the correct number of decimals. Will not
38-- | Show the discrete value with the correct number of decimals. Will not
39−-- | prepend the currency sign. Negative numbers are prefixed with a
39+-- | prepend the currency sign. Negative amounts are prefixed with a
40-- | hyphen-minus.
40-- | hyphen-minus.
44+-- | - `showDiscrete (Discrete 256 :: Discrete GBP) == "2.56"`
45+-- | - `showDiscrete (Discrete (-256) :: Discrete GBP) == "-2.56"`
41showDiscrete :: ∀ c. (Currency c) => Discrete c -> String
46showDiscrete :: ∀ c. (Currency c) => Discrete c -> String
42showDiscrete (Discrete n) =
47showDiscrete (Discrete n) =
43 unsafeToFixed d (Int.toNumber n / pow 10.0 (Int.toNumber d))
48 unsafeToFixed d (Int.toNumber n / pow 10.0 (Int.toNumber d))