awk and printf

echo $bbsize
1.5

echo $fillpercent

.95

echo $bbsize | awk '{printf "%.2f\n",$0*$fillpercent}'

2.25
echo $bbsize | awk '{printf "%.2f\n",$0*.95}'
1.42

1.42 is what I'm expecting...

echo $blocksize
4096
echo $bbsize | awk '{printf "%.2f\n",$0*$blocksize}'
2.25
echo $bbsize | awk '{printf "%.2f\n",$0*4096}'
6144.00

6144 is what I'm EXPECTING.

Where am I going wrong?

you can't use the shell variable inside awk directly

 
echo 1.5|awk -v var=$fillpercent '{printf "%.2f\n",$0*var}'

this will give the req ans

echo $bbsize | awk '{printf "%.2f\n",$0*myvar}' myvar="${fillpercent}"
echo $bbsize | awk '{printf "%.2f\n",$0*$blocksize}' myvar="${bbsize}" 
echo "scale=2; $bbsize * $blocksize" | bc

One thing I'm doing in that script is starting a bb process to run in the background. I'd like to be able to trap the termination of the script and also kill that dd it started in the background. Have any good tips on how to accomplish that?