MathGroup Archive 2003

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

Search the Archive

RE: number formatting again

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45041] RE: [mg45031] number formatting again
  • From: "David Park" <djmp at earthlink.net>
  • Date: Sun, 14 Dec 2003 06:22:38 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Peter,

To control the exponent add ExponentFunction to the NumberForm statement. To
have no exponent you want and ExponentFunction that always returns Null.

129384759.133
NumberForm[%, {20, 3}, ExponentFunction -> (Null &)]
1.29384759133*^8
129384759.133


David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

From: mandarino [mailto:pams at wwwsrv1.cepus.net]
To: mathgroup at smc.vnet.net


I have done some geodetic-GPS calculations recently, and mostly I want to
format my calculations with 3 decimal places (mm accuracy), because the
integer part of a calculation can be a number with ~1-7 digits it is nowdays
difficult to find a formatting procedure that print out all digits to the
third decimal  (without exponential format).
I work with NumberFormat, Scientificformat and EngineeringFormat but they
does not seem to work in all cases, (in some cases I get exponential
formatting).

example:
I want to use a simple way to make Mathematica print out the results:

Like this: 12.456  m and 129384759.133 m

and not like this: 1.29384759133 10^8 in the last case.

Is there some better way to handle this formatting problem that somebody can
suggest?
I used to use N[x,n] (in version 3.1) wich nowdays behaves differently.
e.g.
N[Pi,30]= 3.14159265358979328464338328
and
N[Pi,10]=3.14159
As you can see one have no control over the number of printed decimals.
I know it is possible to construct some formatting Module or function, but
this is not what I want.
Best
Peter W




  • Prev by Date: Re: Different limits for simplied and non-simplified function
  • Next by Date: Re: boundary condition for NDSolve
  • Previous by thread: number formatting again
  • Next by thread: Map Question