Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

Re: ? write/save truncated numbers to file

  • To: mathgroup at
  • Subject: [mg1970] Re: [mg1953] ? write/save truncated numbers to file
  • From: m1mef00 at FRB.GOV
  • Date: Wed, 30 Aug 1995 01:50:30 -0400

Thang Cao Nguyen writes:

>> The idea is that i don't need to save full-accuracy numbers (often
>> reaching 14-15 decimal places), and instead wanted, say, 2-3 decimal
>> places.

Will this help?

In[60]:= round[x_, dec_:3] := N[Round[10^dec x]/10^dec]

In[61]:= FullForm /@ {N[1 + 1/7], round[1 + 1/7]}

Out[61]= {1.142857142857143, 1.143}


Mark Fisher
Mail Stop 91
Federal Reserve Board
Washington, DC 20551

voice:	202-452-2258
fax:	202-452-3819
e-mail:	mfisher at

  • Prev by Date: Find with line returns
  • Next by Date: Help in defining nearly orderless function
  • Previous by thread: Re: ? write/save truncated numbers to file
  • Next by thread: Question about diff. operators