Data.ByteString.Builder.Scientific

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 #

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 #

Arguments

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

Like `scientificBuilder` but provides rendering options.

data 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.

#### Instances

Instances details

Bounded FPFormat |
Instance details Defined in Data.Text.Lazy.Builder.RealFloat Methods minBound :: FPFormat # maxBound :: FPFormat #
Enum FPFormat |
Instance details Defined in Data.Text.Lazy.Builder.RealFloat 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 |
Instance details Defined in Data.Text.Lazy.Builder.RealFloat Methods readsPrec :: Int -> ReadS FPFormat # readList :: ReadS [FPFormat] # readPrec :: ReadPrec FPFormat # readListPrec :: ReadPrec [FPFormat] #
Show FPFormat |
Instance details Defined in Data.Text.Lazy.Builder.RealFloat Methods showsPrec :: Int -> FPFormat -> ShowS # show :: FPFormat -> String # showList :: [FPFormat] -> ShowS #