Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1997
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

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

Search the Archive

Re: How to get 2.334E+6 output form ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg5725] Re: How to get 2.334E+6 output form ?
  • From: dendzik at usctoux1.cto.us.edu.pl (Zbigniew Dendzik)
  • Date: Sat, 11 Jan 1997 14:29:15 -0500
  • Organization: Silesian University, Katowice, Poland
  • Sender: owner-wri-mathgroup at wolfram.com

Zbigniew Dendzik (dendzik at usctoux1.cto.us.edu.pl) wrote:
: Sergio Rojas (sergio at scisun.sci.ccny.cuny.edu) wrote:

: (...)
: : How can one tell to Mathematica to write
: :                                                                   6
: : numbers in the form 2.3456E+6 instead of 2.3456*10^6 (or 2.3456 10 ).

: (...)
: :  How the data can be written to a file without the braces and comma in 
: : between?

: (...)


: Hi Sergio,

: Below is a simple piece of Mma code which I have written to solve this
: problem.

: RegularForm[x_]:= OutputForm[NumberForm[TableForm[x//N], ExponentFunction->
: (If[-10<#<10, Null, #]&), NumberFormat->(If[#3=="", SequenceForm[#1, #3],
: SequenceForm[#1, "E", #3]]&)]]

: If you put the above definition into the file named user.m (for example,
: or simply add it to your init.m file), you will get:
(...)


Not long after I have posted above message I noticed that some data
processing software (e.g. Origin (TM)) does not accept files with empty lines
between data. Below is the code that writes converted data in more condensed
form (without empty lines):

RegularForm[x_]:= OutputForm[NumberForm[TableForm[x//N, TableSpacing->{0, 6}], 
ExponentFunction->(If[-10<#<10, Null, #]&), NumberFormat->(If[#3=="", 
SequenceForm[#1, #3], SequenceForm[#1, "E", #3]]&)]]

--Zbigniew Dendzik
dendzik at us.edu.pl









  • Prev by Date: Mathematica & MIDI/Macintosh
  • Next by Date: Re: How to make Mathematica to return "Log[Exp[x]]" as x?
  • Previous by thread: Re: How to get 2.334E+6 output form ?
  • Next by thread: Interaction with programs