HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Moduledouble-conversion-2.0.5.0Haskell2010

Data.Double.Conversion.ByteString

This module left now only for compatibility and should not be used in new projects. Please, use Convertable type class from Data.Double.Conversion.Convertable

It is espesially recommended to convert a large amount of numbers via bytestring builder using methods of Convertable type class. It is about 10-15x faster.

Fast, efficient support for converting between double precision floating point values and text.

Although about 15 times faster than plain show, these functions are slower than their Text counterparts, at roughly half the speed. (This seems to be due to the cost of allocating ByteString values via malloc.)

  • 4 values
valuetoExponential :: Int -> Double -> ByteString
#

Compute a representation in exponential format with the requested number of digits after the decimal point. The last emitted digit is rounded. If -1 digits are requested, then the shortest exponential representation is computed.

valuetoFixed :: Int -> Double -> ByteString
#

Compute a decimal representation with a fixed number of digits after the decimal point. The last emitted digit is rounded.

valuetoPrecision :: Int -> Double -> ByteString
#

Compute precision leading digits of the given value either in exponential or decimal format. The last computed digit is rounded.