text-1.2.2.2: An efficient packed Unicode text type.

Copyright | (c) The University of Glasgow 1994-2002
License | see libraries/base/LICENSE
Safe Haskell | Trustworthy
Language | Haskell98

Data.Text.Lazy.Builder.RealFloat

Description

Write a floating point value to a `Builder`.

Synopsis

- data FPFormat
  - = Exponent
  - | Fixed
  - | Generic
- realFloat :: RealFloat a => a -> Builder
- formatRealFloat :: RealFloat a => FPFormat -> Maybe Int -> a -> Builder

# Documentation

data FPFormat Source #

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.

Instances

Enum FPFormat Source # |
Methods succ :: FPFormat -> FPFormat # pred :: FPFormat -> FPFormat # toEnum :: Int -> FPFormat # fromEnum :: FPFormat -> Int # enumFrom :: FPFormat -> [FPFormat] # enumFromThen :: FPFormat -> FPFormat -> [FPFormat] # enumFromTo :: FPFormat -> FPFormat -> [FPFormat] # enumFromThenTo :: FPFormat -> FPFormat -> FPFormat -> [FPFormat] #
Read FPFormat Source # |
Methods readsPrec :: Int -> ReadS FPFormat # readList :: ReadS [FPFormat] # readPrec :: ReadPrec FPFormat # readListPrec :: ReadPrec [FPFormat] #
Show FPFormat Source # |
Methods showsPrec :: Int -> FPFormat -> ShowS # show :: FPFormat -> String # showList :: [FPFormat] -> ShowS #

realFloat :: RealFloat a => a -> Builder Source #

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 Source #

Arguments

:: RealFloat a |
=> FPFormat |
-> Maybe Int | Number of decimal places to render.
-> a |
-> Builder |