From 86d22ce29ddf22ddb4617b7271dd6e5857f22416 Mon Sep 17 00:00:00 2001 From: Peter Lebbing Date: Fri, 19 Apr 2024 12:31:47 +0200 Subject: [PATCH] Document `NumberFormat` deviates from aeson --- Data/Aeson/Encode/Pretty.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Data/Aeson/Encode/Pretty.hs b/Data/Aeson/Encode/Pretty.hs index b646311..48ce9fa 100644 --- a/Data/Aeson/Encode/Pretty.hs +++ b/Data/Aeson/Encode/Pretty.hs @@ -95,10 +95,11 @@ data PState = PState { pLevel :: Int data Indent = Spaces Int | Tab data NumberFormat - -- | The standard behaviour of the 'Aeson.encode' function. Uses - -- integer literals for integers (1, 2, 3...), simple decimals - -- for fractional values between 0.1 and 9,999,999, and scientific - -- notation otherwise. + -- | For numbers with absolute value less than 1e19, this follows the standard + -- behaviour of the 'Data.Aeson.encode' function. Uses integer literals for + -- integers (1, 2, 3...), simple decimals for fractional values between 0.1 + -- and 9,999,999, and scientific notation otherwise. For numbers with an + -- absolute value larger than 1e19, always uses scientific notation. = Generic -- | Scientific notation (e.g. 2.3e123). | Scientific