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