My script
#!/bin/bash
echo -n "number 1 :";
read number1
echo -n "number 2 :";
read number2
jlh=$(echo $number1 + $number2 | bc -l | sed 's/^\./0./');
echo "your result : $number1 + $number2 = $jlh "
if input for number 1 is -1
, and number 2 is 0.9
, why the result only -.1
.
I want to show the zero like this.
Your result : -1 + 0.9 = -0.1
How I can do it?