jurij
asked on
bash programming - displaying (real) numbers
Hello!
I'm having problems with bash programming - when i try to do something like:
a=3
b=5
echo div: $(($a/$b))
I get 'div: 0'.
How can i display decimals?
|bc -l? how?
TNX
I'm having problems with bash programming - when i try to do something like:
a=3
b=5
echo div: $(($a/$b))
I get 'div: 0'.
How can i display decimals?
|bc -l? how?
TNX
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
b=5
decimal_places=3
echo "scale=$decimal_places; $a/$b" | bc