2007/10/2, Kurt H Maier <karmaflux_AT_gmail.com>:
> I could never get the precision set right. It would either round to
> the nearest ten, or there would be a decimal. After about ten minutes
> of trying to make it output a value with length 0 and scale 1 or 2, I
> used perl.
>
just divide by 1.0, ie:
else
BATT_REMAIN_HR=`echo "($BATT_CAPACITY/$BATT_RATE)/1.0" | bc`
BATT_REMAIN_MN=`echo "(($BATT_CAPACITY/$BATT_RATE*60)%60)/1.0" | bc`
fi
Received on Tue Oct 02 2007 - 15:44:23 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:56:53 UTC