Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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, ... ?

share|improve this question
    
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) –  Nasser Oct 31 '13 at 1:55
    
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"? –  Tom Oct 31 '13 at 2:05
    
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. –  Nasser Oct 31 '13 at 2:11
1  
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. –  Nasser Oct 31 '13 at 2:20
1  
for the sake of completion: replacing the " " by "[ThinSpace]" gives the thin space. –  Tom Oct 31 '13 at 2:26

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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