HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulerebase-1.21.2Haskell2010

Rebase.Data.Text.Lazy.Builder.RealFloat

  • 1 type
  • 2 values
  • Packagerebase-1.21.2
  • Exports3
  • LanguageHaskell2010
  • LicenceMIT
  • SourceRealFloat.hs
datadata FPFormat
#

Control the rendering of floating point numbers.

Constructors

  • Exponent

    Scientific notation (e.g. 2.3e123).

  • Fixed

    Standard decimal notation.

  • Generic

    Use decimal notation for values between 0.1 and 9,999,999, and scientific notation otherwise.

Instances4Bounded, Enum, Read, Show
  • Bounded FPFormatDefined in text-2.1.3 · Data.Text.Lazy.Builder.RealFloat
  • Enum FPFormatDefined in text-2.1.3 · Data.Text.Lazy.Builder.RealFloat
  • Read FPFormatDefined in text-2.1.3 · Data.Text.Lazy.Builder.RealFloat
  • Show FPFormatDefined in text-2.1.3 · Data.Text.Lazy.Builder.RealFloat
valueformatRealFloat
  1. :: RealFloat a
  2. => FPFormat
  3. -> Maybe Int

    Number of decimal places to render.

  4. -> a
  5. -> Builder
#

Encode a signed RealFloat according to FPFormat and optionally requested precision.

This corresponds to the show{E,F,G}Float operations provided by base's Numeric module.

NOTE: The functions in base-4.12 changed the serialisation in case of a Just 0 precision; this version of text still provides the serialisation as implemented in base-4.11. The next major version of text will switch to the more correct base-4.12 serialisation.

valuerealFloat :: RealFloat a => a -> Builder
#

Show a signed RealFloat value to full precision, using standard decimal notation for arguments whose absolute value lies between 0.1 and 9,999,999, and scientific notation otherwise.