Convert e+ to number

Hi,

I am using awk to get particular dates in seconds and the output am getting is like 1.28071e+09.

How can I convert it to number format.

Can anyone help me out?

Thanks in advance..!

Post code you are using, that is producing that output.

Am using the following line code in awk,

secs1=((year1 - 1970)*365.25+(month1*30.5)+day1)*24*60*60;

In bash:

printf "%10.0f\n" 1.28071e+09

Thanks a lot for your valuable quick response.

One more doubt.

Can I use 'printf' in any unix env as I don't have much idea of printf in unix.

The OS which I am using is HP-UX.

# echo " (`printf "%.7s\n" 1.28071e+09`) * 1000000000 / 1" | bc
1280710000

You don't have to use the printf function of your OS shell.
You can use printf within awk itself, especially if you are doing all your calculations in an awk script.

$
$ awk 'BEGIN {x = 1.28071e+09; printf("%10.0f\n", x)}'
1280710000
$
$

As a side note, popular shells like KSH and Bash provide the printf function. So if your Unix environment has these shells, then you should be able to use printf.
Otherwise, you may want to check the man page.

tyler_durden

HP-UX also has the /usr/bin/printf command