If you only need 10 digits of precision there's a ComputerArithmetic package that allows you to specify your rounding method under limited conditions.
Needs["ComputerArithmetic`"]
SetArithmetic[10, RoundingRule->Truncation]
This will set up our arithmetic system, but in order to use it, we'll need to use ComputerNumber[]
N[ComputerNumber[Pi],10]
yields an output of 3.141592653
N[ComputerNumber[EulerGamma],10]
yields an output of 0.5772156649. But keep in mind this is 10 total digits of precision so if we do this:
N[ComputerNumber[100*EulerGamma],10]
we'll get 57.72156649 and not 57.7215664901
If you require more flexible precision you'll want to do what Sjoerd C. de Vries recommended. I've wrapped everything in a SetPrecision[]
for clarity because without it Mathematica will hide the output of everything but the first 6 significant digits:
NTrunc[number_, precision_Integer] :=
SetPrecision[
Floor[
N[number, precision + 1],
10^-(precision - 1)],
precision]
IntegerPart[Pi 10^9]/10.^9
:) $\endgroup$ – Kuba♦ Dec 16 '13 at 21:24StringTake[ToString[N[Pi, 11]], 11]
$\endgroup$ – george2079 Dec 16 '13 at 21:343.141592653
:-) $\endgroup$ – Cassini Dec 16 '13 at 22:51