Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

1 Answer 1

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.