Re: Rounding numbers
- To: mathgroup at smc.vnet.net
- Subject: [mg37375] Re: Rounding numbers
- From: "Dana DeLouis" <delouis at bellsouth.net>
- Date: Fri, 25 Oct 2002 02:48:31 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Thank you everyone. Looks like there is no built-in way to Round to a
certain level. I hate the thought of Multiplying and Dividing, but it
looks like the only workaround.
A search of the archives shows that this is a real problem. I also
found many complaints on not being able to Round Pi or E to something
less than 16 digits. (Every solution affected the display, not the
number)
Thanks Bob for your Help.
Thanks Matthias for the following idea also.
(Round[N[Pi*1000, 10]])/1000 // N
Sorry for the late Thank you. I am not use to being in a moderated
newsgroup where you have to send an email instead of hitting the normal
Reply Group button.
--
Dana DeLouis
Windows XP
$VersionNumber -> 4.2
= = = = = = = = = = = = = = = = =
<BobHanlon at aol.com> wrote in message news:anrkae$3ui$1 at smc.vnet.net...
>
> In a message dated 10/6/2002 7:39:38 AM, delouis at bellsouth.net writes:
>
> >Could somebody please inform me how to Round numbers to a
> >certain Accuracy using Mathematica 4.2. This is not as easy as it
> >sounds.
> >Every function that I have read Rounds the Display, and not the
actual
> >number.
>
> myRound[x_, n_] := Round[10^n*x]/10.^n;
>
> Table[myRound[Random[], 3], {10}]
>
> {0.044, 0.019, 0.738, 0.298, 0.917, 0.171, 0.021, 0.314,
> 0.658, 0.153}
>
> Bob Hanlon