Problem in summing an array

Hi Frnds

I need to sum up the values of a single array and store it in another variable, here is what im trying

     sumArray=0
     for i in ${srvcFeeAmt[@]}
     do
        echo " s of i value----> "$i
        sumArray=`expr $sumArray + ${i}`
     done
     echo "Sum of the array----> "$sumArray

but getting the following error message

 s of i value----> 20.00
parsingIfNew.ksh[58]: 0: not found [No such file or directory]
 s of i value----> 40.00
parsingIfNew.ksh[58]: +: not found [No such file or directory]
Sum of the array---->

Please help me with this.... thanks in advance.....

Hi,

Shell can't manage floating point so try something like

sumArray=$(echo "$sumArray + $i" | bc)

Thank you so much... Problem resolved!!