2
$\begingroup$

Is there any way to change the general settings in Mathematica so that when I type e.g.

0.34*60000000 

I get the output

20400000. 

as opposed to the (for me not useful) representation

2.04*10^7 

?

i.e. I want the raw number, not the formatted/adjusted form. And I do not want to use operators like SetPrecision. Ideally, I just want to change the settings so that whenever I type in a number I get the full answer. Is this possible? Perhaps using some command like SetOptions[$FrontEnd, ... ?

$\endgroup$
9
  • $\begingroup$ You can use 0.34*60000000 // AccountingForm I do not know now to set this to be automatically applied to each number printed. see mathematica.stackexchange.com/questions/20373/… (I think the answer you want is there, just saw it) $\endgroup$ Commented Oct 31, 2013 at 1:55
  • $\begingroup$ It seems when I use $PrePrint = AccountingForm I get exactly what I want. Thanks! But is there a way to keep the digit block seperator set to "Thin Space"? $\endgroup$ Commented Oct 31, 2013 at 2:05
  • $\begingroup$ I think you can using MakeBoxes, but I am not good at that. AccountingForm allready supports setting of DigitsBlocks. Try this: AccountingForm[0.34*60000000, DigitBlock -> 3, NumberSeparator -> ","] But I do not know how to tell it to use small space for separator. Using NumberSeparator -> " " will make the space too large. $\endgroup$ Commented Oct 31, 2013 at 2:11
  • 1
    $\begingroup$ You use use the same $PrePrint command, like this: $PrePrint = AccountingForm[#, DigitBlock -> 3, NumberSeparator -> " "] &; I just do not know how to make the separator small. $\endgroup$ Commented Oct 31, 2013 at 2:20
  • 1
    $\begingroup$ for the sake of completion: replacing the " " by "[ThinSpace]" gives the thin space. $\endgroup$ Commented Oct 31, 2013 at 2:26

1 Answer 1

3
$\begingroup$

One way is to use $PrePrint

 $PrePrint = AccountingForm[#, DigitBlock -> 3, NumberSeparator -> "\[ThinSpace]"] &; 

You can the above to your init.m, so it is loaded each time you start Mathematica and do not have to write it each time.

More information on AccountingForm

Thanks to hint by Tom on the ThinSpace syntax. Related answer by MrWizard.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.