@@ -272,8 +272,9 @@ pad2 n = let (a,b) = n `quotRem` 10 in p a ++ p b
273-- | pad4 assumes its input is positive
273-- | pad4 assumes its input is positive
274pad4 :: (Integral n, Show n) => n -> Builder
274pad4 :: (Integral n, Show n) => n -> Builder
275−pad4 n | n >= 1000 = integral n
275+pad4 n | n >= 10000 = integral n
276− | n >= 100 = fromChar '0' ++ integral n
276+ | otherwise = p a ++ p b ++ p c ++ p d
277− | n >= 10 = fromByteString "00" ++ integral n
277+ where (ab,cd) = n `quotRem` 100
278− | otherwise = fromByteString "000" ++ integral n
278+ (a,b) = ab `quotRem` 10
279+ (c,d) = cd `quotRem` 10
279{-# INLINE pad4 #-}
280{-# INLINE pad4 #-}