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.

1

1 Answer 1

0

I figured it out:

b=$( echo "$a+($a*0.02)" | bc )

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.