MathGroup Archive 2007

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

Search the Archive

Re: Re: NumberPadding on the left

  • To: mathgroup at
  • Subject: [mg82906] Re: [mg82902] Re: NumberPadding on the left
  • From: Carl Woll <carlw at>
  • Date: Sat, 3 Nov 2007 03:21:24 -0500 (EST)
  • References: <fg9pq4$n29$><fgc9qk$90c$> <>

zac wrote:

>Thanks for pointing that out.
>Based on this information, I've written a simple function to simulate
>the behaviour I wanted to achieve:
>DigitForm::usage="DigitForm[expr, {l,
>r}] prints expression with exactly r numerical digits on the right
>(rounding \
>fractional part) and exactly l (or more, if needed) numerical digits
>on the \
>left side of the decimal point.";
>      left=If[l==="Default",1,l];
>      pad=If[l==="Default",{"",pad[[2]]},pad];
>      NumberForm[N[num],{left+r,r},NumberPadding\[Rule]pad,NumberSigns\
>        ""},SignPadding\[Rule]True,FilterOptions[NumberForm,opts]]];
>which prints exactly those numbers I need.
>If anyone could come up with a more simple function, please let me
>know that!
Why don't you use:

NumberSigns->{"-"," "}




Carl Woll
Wolfram Research

  • Prev by Date: Re: Setting Negatives to Zero
  • Next by Date: Re: Re: NDSolve with functions of vectors
  • Previous by thread: Re: NumberPadding on the left
  • Next by thread: Re: MultivariateDistribution mathematica 6