scientific-0.3.8.0: Numbers represented using scientific notation

Safe Haskell | Safe
Language | Haskell2010

Data.ByteString.Builder.Scientific

Synopsis

- scientificBuilder :: Scientific -> Builder
- formatScientificBuilder :: FPFormat -> Maybe Int -> Scientific -> Builder
- data FPFormat
  - = Exponent
  - | Fixed
  - | Generic

# Documentation

scientificBuilder :: Scientific -> Builder Source #

A `ByteString` `Builder` which renders a scientific number to full precision, using standard decimal notation for arguments whose absolute value lies between `0.1` and `9,999,999`, and scientific notation otherwise.

formatScientificBuilder Source #

Arguments

:: FPFormat |
-> Maybe Int | Number of decimal places to render.
-> Scientific |
-> Builder |

Like `scientificBuilder` but provides rendering options.

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

Instances details

Bounded FPFormat |
Instance details Defined in Data.Text.Lazy.Builder.RealFloat Methods minBound :: FPFormat Source # maxBound :: FPFormat Source #
Enum FPFormat |

Instance details

Defined in Data.Text.Lazy.Builder.RealFloat

Methods

succ :: FPFormat -> FPFormat Source #

pred :: FPFormat -> FPFormat Source #

toEnum :: Int -> FPFormat Source #

fromEnum :: FPFormat -> Int Source #

enumFrom :: FPFormat -> [FPFormat] Source #

enumFromThen :: FPFormat -> FPFormat -> [FPFormat] Source #

enumFromTo :: FPFormat -> FPFormat -> [FPFormat] Source #

enumFromThenTo :: FPFormat -> FPFormat -> FPFormat -> [FPFormat] Source #

Read FPFormat |
Instance details Defined in Data.Text.Lazy.Builder.RealFloat Methods readsPrec :: Int -> ReadS FPFormat Source # readList :: ReadS [FPFormat] Source # readPrec :: ReadPrec FPFormat Source # readListPrec :: ReadPrec [FPFormat] Source #
Show FPFormat |
Instance details Defined in Data.Text.Lazy.Builder.RealFloat Methods showsPrec :: Int -> FPFormat -> ShowS Source # show :: FPFormat -> String Source # showList :: [FPFormat] -> ShowS Source #