unable to return a decimal value from a function

Hi Guys,

I am unable to return a decimal value from a function to the main script.
I am getting the correct value in the function but when it is returning to the main script using "return" it is coming as 0. Below is my code.

read VALUE_V fun_FATHERID fun_SONID fun_TOPID fun_RTYPE < function_output.dat;
echo "outside=$VALUE_V";
echo "outside=$fun_FATHERID";

wc -l function_output.dat | read length dummy;
echo "length=$length";

if [ "$length" -eq "1" ] -a [ "fun_RTYPE" -eq "RW" ]
then
echo "value_v=$VALUE_V";
echo "chile_value=$child_value";
VALUE_V=$(echo "scale=4; $VALUE_V * $child_value" | bc);
echo "inside fucntion=$VALUE_V";
return $VALUE_V;
fi

Thanks for your help in advance.

Regards,
Magesh.

---------- Post updated at 08:22 PM ---------- Previous update was at 08:20 PM ----------

above is the code of the function. the main script just calls this function.

return is not same as in programming languages.
return is exit code, caller can read it from variable ?
Return value must put to the stdout and caller read it from stdin.
Example:

function sum()
{
   v1=$1
   v2=$2
   (( res = v1 + v2 ))
   echo "$res"
   return 100
}


total=$(  sum 1 2 )
stat=$?
echo "result is $total and exit code was $stat"

Thanks KSHJI.. it was helpful