Is there a quick and easy way to truncate a decimal number, say beyond 4 digits, in MATHEMATICA?
With N[1/6, 4]
it rounds to =1.6667
.
I want you to cut to 1.6666
.
Thanks!
Is there a quick and easy way to truncate a decimal number, say beyond 4 digits, in MATHEMATICA?
With N[1/6, 4]
it rounds to =1.6667
.
I want you to cut to 1.6666
.
Thanks!
f[x_, n_] := N[IntegerPart[x 10^n]/10^n]
f[1/6, 4]
1.6666
However, note
f[N[531/25], 4]
21.2399
so really some further refinement is required.