MathGroup Archive 2004

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

Search the Archive

Re: Formatting numbers for output

  • To: mathgroup at smc.vnet.net
  • Subject: [mg51556] Re: [mg51508] Formatting numbers for output
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Thu, 21 Oct 2004 22:22:34 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Perhaps the following can help:

In[1]:=
nums = {{1., 3.2}, {3.4567, -27}};

In[2]:=
pp[x__] := NumberForm[x, {12, 2},
   NumberPadding -> {"", "0"}, DigitBlock -> 3,
   ExponentFunction -> (Null & )]

In[3]:=
SetAttributes[pp, Listable]

In[4]:=
StylePrint[DisplayForm[StyleBox[GridBox[pp[nums],
     GridFrame -> 2, RowLines -> True,
     ColumnLines -> True, ColumnAlignments ->
      {Right}]]], FontFamily -> "Arial",
  FontSize -> 9]

Tomas Garza
Mexico City
----- Original Message ----- 
From: "Alex Gittens" <rubberduckie at gmail.com>
To: mathgroup at smc.vnet.net
Subject: [mg51556] [mg51508] Formatting numbers for output


> I'm trying to construct a GridBox with entries that have 2 digits
> after the decimal. So far, the only way I've seen to get rid of the
> NumberMarks is to use
> SetPrecision[x, :inf:], but that makes all the numbers into fractions.
> Is there a better alternative?
>
> Thanks,
> Alex
>
> -- 
> The heart of mathematics consists of concrete examples and concrete
problems.
>
>



  • Prev by Date: Re: MultipleListPlot without any Point Shape, only with line made by PlotJoined -> True tests=INVALID_DATE,QUOTED_EMAIL_TEXT,RCVD_IN_ORBS,
  • Next by Date: Re: Extrapolation in mathematica
  • Previous by thread: Re: Formatting numbers for output
  • Next by thread: Re : Pretty print