RE: Silly Gridbox[] question
- To: mathgroup at smc.vnet.net
- Subject: [mg39440] RE: [mg39429] Silly Gridbox[] question
- From: "David Park" <djmp at earthlink.net>
- Date: Sat, 15 Feb 2003 01:42:26 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Gerard,
That seems to be a strange bug in GridBox. But I think you can get around it
this way...
tempM = {{1, 1, 1, 0, 0, 15}, {1, 2, 0, 1, 0, 10}, {8, 4, 0, 0, 1,
32}, {-10, -12, 0, 0, 0, 0}};
tempM2 = Map[NumberForm[#, {3, 0}] &, tempM, {2}];
DisplayForm[GridBox[tempM2, ColumnAlignments -> {Right}]]
David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/
From: Gerard Brunick [mailto:gbrunick at andrew.cmu.edu]
To: mathgroup at smc.vnet.net
I'm trying to format a text box to look like the simplex tableau in the book
we are using. I can get the Gridbox to put the lines in where I want them,
but I'm having problems with N[]. In some cases, I would like to use N[] on
a matrix to get a decimal representation, but when I do this the output I
get starts using scientific notation? I can't seem to figure out how to
stop this. Any help would be appreciated. The example follows:
In[187]:=
tempM={{1,1,1,0,0,15},{1,2,0,1,0,10},{8,4,0,0,1,32},{-10,-12,0,0,0,0}}
DisplayForm[GridBox[tempM]]
DisplayForm[GridBox[N[tempM]]]
Out[187]=
{{1,1,1,0,0,15},{1,2,0,1,0,10},{8,4,0,0,1,32},{-10,-12,0,0,0,0}}
Out[188]//DisplayForm=
\!\(\*
TagBox[GridBox[{
{"1", "1", "1", "0", "0", "15"},
{"1", "2", "0", "1", "0", "10"},
{"8", "4", "0", "0", "1", "32"},
{\(-10\), \(-12\), "0", "0", "0", "0"}
}],
DisplayForm]\)
Out[189]//DisplayForm=
\!\(\*
TagBox[GridBox[{
{"1.", "1.", "1.", "0.0", "0.0", "15."},
{"1.", "2.", "0.0", "1.", "0.0", \( .1 e2\)},
{"8.", "4.", "0.0", "0.0", "1.", "32."},
{\(\(- .1\) e2\), \(-12. \), "0.0", "0.0", "0.0", "0.0"}
}],
DisplayForm]\)
Thanks,
Gerard