Community
Modules 50

Data.Text.Lazy.Builder.RealFloat

Write a floating point value to a Builder.

data FPFormat

Control the rendering of floating point numbers.

Exponent :: FPFormat

Scientific notation (e.g. 2.3e123).

Fixed :: FPFormat

Standard decimal notation.

Generic :: FPFormat

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

realFloat :: (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.

formatRealFloat :: (RealFloat a) => FPFormat -> Maybe Int -> a -> 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.

Number of decimal places to render.

Instances

4
  • instance Enum FPFormat
  • instance Read FPFormat
  • instance Show FPFormat
  • instance Bounded FPFormat
Copyright
(c) The University of Glasgow 1994-2002
License
see libraries/base/LICENSE
Build record and source files

Community contribution. The service has not verified this documentation. The generator reported 2 diagnostics.

Target: Linux on x86-64. Some inferred types and resolved links are not available.

Generator: aihc-haddock-858b1951-web-1

Metadata snapshot: 0b0724abd14577f7a6c8172d62e3e1c0808feb114d4d379402e17f37e3c7801e

Open the dependency plan · Download the documentation model

Import a package

Enter a package name and an exact version from Hackage. The site contains imported versions only.