1.

Solve : How do I store a real number into a variable??

Answer»

Hi!!

When I DIVIDE a number such as 20 / 100, the value that gets stored in a variable is just the integer part, i.e 0.

I used var=`expr 20 / 100`
Instead of storing 0.2, it stores 0. I need to USE the real value in further calculations.

Please HELP...you can LOOK into bc command
Code: [Select]echo 'scale=2;20/100' | bc



Discussion

No Comment Found