Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: ScientificForm[], formating question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112854] Re: ScientificForm[], formating question
  • From: David Annetts <david.annetts at iinet.net.au>
  • Date: Mon, 4 Oct 2010 06:03:24 -0400 (EDT)

  Hi Nasser,

You'll want something like

ScientificForm[Column[{n, m}], {5, 4},
  NumberFormat -> (Row[{#1, "E", #3}] &), NumberPadding -> {"", "0"}]
to achieve what you want

Regards,

Dave.

On 3/10/2010 15:37, Nasser M. Abbasi wrote:
> Mathematica experts:
>
>
> I can't get ScientificForm[] to always show 4 digits to the right of
> the decimal point.
>
> Example:
>
> n  = 0.087540;
> m = 0.087549;
>
> ScientificForm[Column[{n, m}], 5,  NumberFormat ->  (Row[{#1, "E", #3}]
> &)]
>
>
> This prints like this:
>
> 8.754E-2
> 8.7549E-2
>
> Which is correct, but I want it to display as
>
> 8.7540E-2
> 8.7549E-2
>
> So that all numbers in the table has the same number of digits. so
> 'nicer' to look at.
>
> The problem in this example, n has a zero at the last position, and so
> is not shown (correctly), but I want 4 digits there.
>
> I looked at all the options for ScientificForm and do not see how to
> do it.
>
> thanks
> --Nasser
>
>
>


  • Prev by Date: Re: Mathematica "Fresh Start" on a new computer?
  • Next by Date: Re: ScientificForm[], formating question
  • Previous by thread: ScientificForm[], formating question
  • Next by thread: Re: ScientificForm[], formating question