Re: Align decmal points
- To: mathgroup at smc.vnet.net
- Subject: [mg85003] Re: Align decmal points
- From: Helen Read <hpr at together.net>
- Date: Tue, 22 Jan 2008 01:59:10 -0500 (EST)
- References: <fn1nn1$9eh$1@smc.vnet.net>
- Reply-to: HPR <read at math.uvm.edu>
Steve Gray wrote: > (Best viewed with a fixed-spacing font such as Courier New.) > > I have lists, spheres, of <100 lists {x,y,z,radius}, typically as > follows: > N[spheres] > {{1060.05, 423.413, -171.449, 1102.85}, {33.5541, 16.2535, 14.0345, > 83.8389}, {67.8212, 29.8456, 7.84258, 83.2877}, {55.7474, -6.90536, > 13.6956, 97.1971}, {84.5821, 5.44961, 8.37983, > 99.2468}, {187.597, -144.491, 11.6819, > 257.383}, {62.9557, -6.33653, -5.45155, > 111.918}, {59.9433, -7.63485, -4.95006, > 112.004}, {60.5971, -4.5244, -3.88841, > 109.34}, {62.2891, -6.38914, -3.68097, 110.48}, {54.918, 10.2798, > 22.727, 97.2316}, {72.0123, 17.306, 19.4247, 98.0057}, {76.3649, > 4.28294, 31.4533, 114.151}, {53.7474, 34.5342, 35.4736, > 103.675}, {61.7639, -3.8727, -1.2733, 109.211}} > > I want to print this in MatrixForm but with the decimal points of > successive rows aligned, like this: (1060.0, etc., would be ok too) > (here the matrix brackets are missing) > > 1060. 423.4 -171.4 1102.9 > 33.6 16.3 14. 83.8 > 67.8 29.8 7.8 83.3 > 55.7 -6.9 13.7 97.2 > 84.6 5.4 8.4 99.2 > 187.6 -144.5 11.7 257.4 > 63. -6.3 -5.5 111.9 > 59.9 -7.6 -5. 112. > 60.6 -4.5 -3.9 109.3 > 62.3 -6.4 -3.7 110.5 > 54.9 10.3 22.7 97.2 > 72. 17.3 19.4 98. > 76.4 4.3 31.5 114.2 > 53.7 34.5 35.5 103.7 > 61.8 -3.9 -1.3 109.2 > > Print[MatrixForm[Round[spheres, .1]]] does it except the decimal > points are not aligned. I will appreciate any tips. Thank you. mm = {{1060.05, 423.413, -171.449, 1102.85}, {33.5541, 16.2535, 14.0345, 83.8389}, {67.8212, 29.8456, 7.84258, 83.2877}, {55.7474, -6.90536, 13.6956, 97.1971}, {84.5821, 5.44961, 8.37983, 99.2468}, {187.597, -144.491, 11.6819, 257.383}, {62.9557, -6.33653, -5.45155, 111.918}, {59.9433, -7.63485, -4.95006, 112.004}, {60.5971, -4.5244, -3.88841, 109.34}, {62.2891, -6.38914, -3.68097, 110.48}, {54.918, 10.2798, 22.727, 97.2316}, {72.0123, 17.306, 19.4247, 98.0057}, {76.3649, 4.28294, 31.4533, 114.151}, {53.7474, 34.5342, 35.4736, 103.675}, {61.7639, -3.8727, -1.2733, 109.211}}; Grid[mm, Alignment -> "."] (Grid is pretty good with this regardless of font.) -- Helen Read University of Vermont