Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nickie committed Oct 31, 2016
1 parent 6fbffc5 commit 3aa07ea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Data/Yaml/Extended.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ toString :: Value -> Maybe String
toString (String t) = Just (T.unpack t)
toString (Bool True) = Just "true"
toString (Bool False) = Just "false"
-- | Make sure that numeric fields containing integer numbers are shown as
-- | integers (i.e., "42" instead of "42.0").
toString (Number d) | isInteger d = Just (formatScientific Fixed (Just 0) d)
| otherwise = Just (show d)
toString _ = Nothing
Expand Down

0 comments on commit 3aa07ea

Please sign in to comment.