Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Floating point problem

Status
Not open for further replies.
May 8, 2004
92
GB

Hi,
I am trying to do division to get percentage. I have used bc to get the float number like 60.0.
however, later on i cant use this same variable in IF statment to make comparison for less than 70. Can anyone help me with this.

Percentage=$(echo "scale=1;(( $Rcount / $Fcount ) * 100 )" | bc )


if [ $Percentage -lt 70 ]
then
echo $Percentage
fi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top