@@ -36,8 +36,13 @@ instance rightModuleDiscrete :: RightModule (Discrete c) Int where
3636 mmulR (Discrete a) b = Discrete (a * b)
3737
3838-- | 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
4040-- | hyphen-minus.
41+-- |
42+-- | Examples:
43+-- |
44+-- | - `showDiscrete (Discrete 256 :: Discrete GBP) == "2.56"`
45+-- | - `showDiscrete (Discrete (-256) :: Discrete GBP) == "-2.56"`
4146showDiscrete :: ∀ c. (Currency c) => Discrete c -> String
4247showDiscrete (Discrete n) =
4348 unsafeToFixed d (Int.toNumber n / pow 10.0 (Int.toNumber d))