MathGroup Archive 2009

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

Search the Archive

Re: Re: Formatting Numeric Outpuit

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104859] Re: [mg104821] Re: [mg104782] Formatting Numeric Outpuit
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Thu, 12 Nov 2009 06:01:34 -0500 (EST)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200911110925.EAA29212@smc.vnet.net>
  • Reply-to: murray at math.umass.edu

That NumberForm does not have attribute Listable does not seem to be the 
whole story, since in fact NumberForm does act upon the individual 
numbers in a List when it directly displays that list. For example:

   n1 = RandomReal[100, 2];
   NumberForm[n1, {3, 3}]
{68.900,6.860}

Bob Hanlon wrote:
> n1 = RandomReal[100, 10];
> 
> (n2 = NumberForm[n1, {3, 3}])//FullForm
> 
> Look at the FullForm of your n2.  Then note that NumberForm does not have the attribute Listable. 
> 
> Attributes[NumberForm]
> 
> {Protected}
> 
> Use
> 
> n2 = NumberForm[#, {3, 3}] & /@ n1;
> 
> Column[n2, Right]
> 
> 
> Bob Hanlon
> 
> ---- BenT <brtubb at pdmusic.org> wrote: 
> 
> =============
> Please consider these Mathematica 7 code Input lines:
> 
> n1 = RandomReal[100, 10]
> 
> n2 = NumberForm[n1, {3, 3}]
> 
> Column[n2, Right]
> 
> What I expected to get was "ignored", namely right aligned "arbitrary"
> numeric data with 3 digits to the right, and 3 digits to the left of
> the decimal point) formatted in a single column. How can this be
> achieved with any numeric list of data?
> 
> --- Benjamin Tubb
> 
> 
> --
> 
> Bob Hanlon
> 
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: NonlinearModelFit on correlated data
  • Next by Date: Solving ODE for rotational, irrotational vector field
  • Previous by thread: Re: Formatting Numeric Outpuit
  • Next by thread: Re: Formatting Numeric Outpuit