MathGroup Archive 2001

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

Search the Archive

Re: Number formatting for financial applications

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27497] Re: [mg27475] Number formatting for financial applications
  • From: Matt.Johnson at autolivasp.com
  • Date: Thu, 1 Mar 2001 03:53:24 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Felipe-

In[113]:=
num = Table[Random[Real, {100, 200}, 20], {5}];
In[114]:=
num
Out[114]=
{105.12644286316683165, 106.60782824863390009, 199.10307327925572660, \
138.86235761139475676, 151.74150262924359452}
In[115]:=
dollars[num_] :=
  StringForm["$ ``", NumberForm[num, {20, 10}, ExponentFunction -> (Null &)]]
In[116]:=
dollars /@ num
Out[116]=
{"$ \!\(\"105.1264428632\"\)", "$ \!\(\"106.6078282486\"\)", "$ \
\!\(\"199.1030732793\"\)", "$ \!\(\"138.8623576114\"\)", "$ \
\!\(\"151.7415026292\"\)"}

-matt





"Felipe" <no at spam.com> on 02/26/2001 10:37:27 PM

cc:
Subject: [mg27497]  [mg27475] Number formatting for financial applications




I am having a hard time getting the format I need in my output. For some
reason Mathematica keeps putting things in engineering form when I just
want
a long number

e.g. I want to display this number

101522688.1906242

like this

$ 101,522,688.1906242 (I can do without the $ if it's too hard)

How can I achieve this without writing ten different tags each time. I just
want to have a formula with this output instead of having to wrap the
formula with AccountingForm[], NumberForm[], DigitBlock, etc. It looks
really ugly when I print it.

thanks
Felipe








**************************************************************************************************************************************
All Autoliv e-mails remain Company property and shall be used for
business-related purposes only.   Do not forward any material contained
within this e-mail without prior, written permission from the author's
manager.  Autoliv disclaims all responsibility and accepts no liability
(including negligence) for the consequences for any person acting, or
refraining from acting on this information prior to the receipt by those
persons of subsequent written confirmation.
**************************************************************************************************************************************




  • Prev by Date: Re: Integrate a matrix-function
  • Next by Date: Re: converting hex strings
  • Previous by thread: Re: Number formatting for financial applications
  • Next by thread: Re: Number formatting for financial applications