Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a big number:


that would be:


are there any parameters in bc that will give this OUTPUT?

$ echo '2923174917395723956 + 1' | bc

Or something similar...the point is that it must have a short look
Thank you!

share|improve this question
up vote 5 down vote accepted

Try the printf command:

$ printf "%e\n" 2923174917395723957

In your locale, it should use , instead of ., of course. You can also control the format more precisely such as:

$ printf "%.3e\n" 2923174917395723957

Some shells like bash have a built-in called printf which may be different from any printf command that comes with the system, but, in general, you shouldn't notice any difference with simple commands like above. You can also use printf from Perl which will be pretty consistent.

$ perl -e 'printf "%.3e\n", 2923174917395723957'
share|improve this answer

Your Answer


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.