MathGroup Archive 1997

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

Search the Archive

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


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