MathGroup Archive 2010

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

Search the Archive

export to file with a specific precision

  • To: mathgroup at
  • Subject: [mg111490] export to file with a specific precision
  • From: miguelwon <miguelwon at>
  • Date: Tue, 3 Aug 2010 06:37:54 -0400 (EDT)


I need to export to a file several numbers with a specific number of
digits on the right of the decimal. I'm trying this with the function
NumberForm[] and Export[] but the problem is that export function is
not exporting only the number but the full inputform. For example, if
I do this:

Export["teste.dat", NumberForm[1.23456, {3, 4}]]

it will write in the file this:

NumberForm[1.23456, {3, 4}]

It happens the same with:

NumberForm[1.23456, {3, 4}]>>"teste.dat".

Another problem is that in the end I need the data in fortran form,
which mean I can't pass to a string before exporting because for the
cases of raw data that are in scientific format the final result will
be a string with "10^x" which is not fortran format.



  • Prev by Date: Re: All pairs shortest paths
  • Next by Date: Relationship between vertices and indices with GraphDistanceMatrix
  • Previous by thread: Re: Graphic3d Plotting of Spheres
  • Next by thread: Re: export to file with a specific precision