[Haskell-beginners] How to convert a float or double number into a string?

yi lu zhiwudazhanjiangshi at gmail.com
Fri Sep 20 02:44:50 CEST 2013


Thank you all! I am considering defining a String -> String function now.


On Fri, Sep 20, 2013 at 12:39 AM, Kim-Ee Yeoh <ky3 at atamo.com> wrote:

>
> On Wed, Sep 18, 2013 at 8:14 PM, yi lu <zhiwudazhanjiangshi at gmail.com>wrote:
>
>> What I need is just as much number of digits as possible. If I can hold
>> as many digits of pi, i.e. 3.1415926535... as possible and save it in a
>> String, it will be perfect!
>>
>
> Perhaps you had some experience with a computer algebra system (Maple,
> Mathematica, etc.) and was expecting similar behavior?
>
> While it's certainly possible to build it on top of Haskell, these kind of
> floating-point features aren't available out of the box. Haskell provides
> only fixed-bitwidth floating point.
>
> As Oscar recommended, you probably want a String -> String function, say
>
> > toEnglish "1.239402874"
> "one point two three nine four zero blah blah"
>
> -- Kim-Ee
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130920/cd557eae/attachment.htm>


More information about the Beginners mailing list