Copyright | (C) 2014-2016 Ryan Scott |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Ryan Scott |
Stability | Provisional |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
Monomorphic TextShow
functions for floating-point types.
Since: 2
- showbRealFloatPrec :: RealFloat a => Int -> a -> Builder
- showbFloatPrec :: Int -> Float -> Builder
- showbDoublePrec :: Int -> Double -> Builder
- showbEFloat :: RealFloat a => Maybe Int -> a -> Builder
- showbFFloat :: RealFloat a => Maybe Int -> a -> Builder
- showbGFloat :: RealFloat a => Maybe Int -> a -> Builder
- showbFFloatAlt :: RealFloat a => Maybe Int -> a -> Builder
- showbGFloatAlt :: RealFloat a => Maybe Int -> a -> Builder
- showbFPFormat :: FPFormat -> Builder
- data FPFormat :: *
- formatRealFloatB :: RealFloat a => FPFormat -> Maybe Int -> a -> Builder
- formatRealFloatAltB :: RealFloat a => FPFormat -> Maybe Int -> Bool -> a -> Builder
Documentation
showbEFloat :: RealFloat a => Maybe Int -> a -> Builder Source #
Show a signed RealFloat
value
using scientific (exponential) notation (e.g. 2.45e2
, 1.5e-3
).
In the call
, if showbEFloat
digs valdigs
is Nothing
,
the value is shown to full precision; if digs
is
,
then at most Just
dd
digits after the decimal point are shown.
Since: 2
showbFFloat :: RealFloat a => Maybe Int -> a -> Builder Source #
Show a signed RealFloat
value
using standard decimal notation (e.g. 245000
, 0.0015
).
In the call
, if showbFFloat
digs valdigs
is Nothing
,
the value is shown to full precision; if digs
is
,
then at most Just
dd
digits after the decimal point are shown.
Since: 2
showbGFloat :: RealFloat a => Maybe Int -> a -> Builder Source #
Show a signed RealFloat
value
using standard decimal notation for arguments whose absolute value lies
between 0.1
and 9,999,999
, and scientific notation otherwise.
In the call
, if showbGFloat
digs valdigs
is Nothing
,
the value is shown to full precision; if digs
is
,
then at most Just
dd
digits after the decimal point are shown.
Since: 2
showbFFloatAlt :: RealFloat a => Maybe Int -> a -> Builder Source #
Show a signed RealFloat
value
using standard decimal notation (e.g. 245000
, 0.0015
).
This behaves as showFFloat
, except that a decimal point
is always guaranteed, even if not needed.
Since: 2
showbGFloatAlt :: RealFloat a => Maybe Int -> a -> Builder Source #
Show a signed RealFloat
value
using standard decimal notation for arguments whose absolute value lies
between 0.1
and 9,999,999
, and scientific notation otherwise.
This behaves as showFFloat
, except that a decimal point
is always guaranteed, even if not needed.
Since: 2
Control the rendering of floating point numbers.
:: RealFloat a | |
=> FPFormat | What notation to use. |
-> Maybe Int | Number of decimal places to render. |
-> a | |
-> Builder |
Like formatRealFloatAltB
, except that the decimal is only shown for arguments
whose absolute value is between 0.1
and 9,999,999
.
Since: 2
:: RealFloat a | |
=> FPFormat | What notation to use. |
-> Maybe Int | Number of decimal places to render. |
-> Bool | Should a decimal point always be shown? |
-> a | |
-> Builder |
Converts a RealFloat
value to a Builder, specifying if a decimal point
should always be shown.
Since: 2