0

I am using bc function in my bash script for simple arithmetic expressions on fractional numbers

c_mod='2.44'
RG_mod='0.55'   

 c_final=$(echo "$c_mod + $RG_mod"  | bc)

This gives me correct value of the c_final = 2.99

cl_tol=$(echo "$c_final * 0.1"  | bc)

But in this case cl_tol= .29 (not 0.29) how I may add zero in the last case ?

Cyrus
  • 77,979
  • 13
  • 71
  • 125
Hot JAMS
  • 173
  • 5

0 Answers0