Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Converting Rationals into Reals

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62045] Re: Converting Rationals into Reals
  • From: albert <awnl at arcor.de>
  • Date: Thu, 10 Nov 2005 02:50:27 -0500 (EST)
  • References: <dksdsr$ha8$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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.

N[yourlist,4]

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

albert


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