MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Converting Rationals into Reals

kristoph wrote:

> I would like to know how I can convert rationals into reals with four
> digits. I know this sounds stange but I need the numbers for a diagram.
> If anyone knows how to covert a whole list of rationals into into four
> digit reals I would be very happy.


will do what you want. Probably what you really want is to get formatted
strings for your diagram, this can be done with:

ToString[PaddedForm[#, {3, 4}]] & /@ N[yourlist]

you can play around with the arguments and options of PaddedForm to achieve
the exact output you want...


  • Prev by Date: Re: Write, Put,..
  • Next by Date: FileNames[] in a loop..
  • Previous by thread: Re: Converting Rationals into Reals
  • Next by thread: To be or not to be...