To get the values, you can use the command:
ping $1 -c1 | cut -sd '/' -f5
But you still can not make a comparison of a float with integer, in addition to the problems that other users cited.
If you really want to compare the value with zero, you can do it this way:
# Salva o valor de retorno na váriavel $avg
avg=$(ping $1 -c1 | cut -sd '/' -f5)
# Converte a variável $avg para int e compara com zero
if [ ${avg%.*} -gt 0 ]; then
# retorna OK caso seja maior que zero
echo "OK"
else
# retorna NO OK caso seja igual ou menor que zero
echo "NO OK"
fi