Script shell, how to calculate percentage?

hello,
please can you help me.

jj and kk are two numbers which are the result of an sql program.

I would like to calculate the ratio jj/kk*100.

I have done this:
ratio=$((jj/kk * 100)) or ratio=`expr $jj \/ expr $kk) but the result is 0

What can i do?
Thanks for help.

math is with integers. multiply first by 100.

$((100*jj/kk))

there is a detailed link from DB which you can use to have an idea:

Hi,

Try use 'bc':

$ jj=43
$ kk=25
$ echo "scale=2 ; ($jj/$kk)" | bc
1.72

Regards,
Birei