4
$\begingroup$

I was trying with DecimalForm, but I read that the suitable one is NumberForm[0.5^20, 12] from version 11.

But when I evaluate

NumberForm[0.5^20, 12]

Mathematica 11 shows the result in scientific notation. How can I obtain the output in pure decimal notation?

$\endgroup$
  • $\begingroup$ You can use an option like NumberForm[0.5^20, {12, 11}, ScientificNotationThreshold -> {-100, 100}]. $\endgroup$ – b.gates.you.know.what Dec 2 '17 at 10:37
  • $\begingroup$ @b.gatessucks Math 11 says NumberForm::optx: Unknown option ScientificNotationThreshold in NumberForm[9.53674 10^(-7),{12,11},ScientificNotationThreshold->{-100,100}]. Mathematica it´s so complicate for simple things!! and so beautifull in other ones. $\endgroup$ – Mika Ike Dec 2 '17 at 10:38
3
$\begingroup$

You can use AccountingForm consult help for it. I tried and look the result

AccountingForm[0.2^20, 40]

0.0000000000000104857600000000
$\endgroup$
  • 1
    $\begingroup$ @MikaIke You might not be happy with AccountingForm when using negative numbers! $\endgroup$ – Carl Woll Dec 2 '17 at 17:11
5
$\begingroup$

Before M11.2 you can use ExponentFunction:

NumberForm[0.5^20, 12, ExponentFunction->(Null&)]

0.000000953674316406

In M11.2 you can also use the option ScientificNotationThreshold as suggested by @b.gatessucks:

NumberForm[0.5^20, 12, ScientificNotationThreshold->{-Infinity, Infinity}]

0.000000953674316406

Instead of NumberForm, you could use DecimalForm:

DecimalForm[.5^20]

0.000000953674316406

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.