I have small problem with use bc command in unix. I have two varaibles: variable1, variable2. The arithmetic expression looks like:
res=$$((($variable1*10)/$variable2)
I would like to round the result from two divided numbers. I think, the best solution will be using bc -l
command + scale=X
, but doesn't work.
res=$$(((echo "scale=2; $variable1*10)/$variable2" | bc -l)
I would like to get more exact result. Now, f.e., I have:
res = 10
But should be
res = 9.23