Skip to content

Commit

Permalink
Switch rendering of Double values to 6 digits of precision.
Browse files Browse the repository at this point in the history
This makes our behaviour more friendly, and a little more similar
to printf besides.
  • Loading branch information
bos committed Jun 29, 2011
1 parent 60392df commit da807dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Data/Text/Buildable.hs
Expand Up @@ -108,11 +108,11 @@ instance (Integral a, Buildable a) => Buildable (Ratio a) where
build a = build (numerator a) <> singleton '/' <> build (denominator a)

instance Buildable Float where
build = fromText . C.toShortest . realToFrac
build = fromText . C.toPrecision 6 . realToFrac
{-# INLINE build #-}

instance Buildable Double where
build = fromText . C.toShortest
build = fromText . C.toPrecision 6
{-# INLINE build #-}

instance Buildable DiffTime where
Expand Down

0 comments on commit da807dd

Please sign in to comment.