0

I am assigning a decimal value to a variable which is an output from an oracle command. when I echo the variable I see the decimal value.

For example, echo $a is showing me .7214 but when I do calculations on this, it is defaulted to integer.

For example, b=$((a+(a*20/100))) is rounding to 1.

How do I avoid rounding this to integer.

RAJ
  • 1

1 Answers1

0

I figured it out:

b=$( echo "$a+($a*0.02)" | bc )
Kusalananda
  • 333,661
RAJ
  • 1