I want to perform the below division operation in shell script and round the value.
val1=6000
val2=5000
res=val1/val2 ----> 1.2---> Round to 2
Please help.
I want to perform the below division operation in shell script and round the value.
val1=6000
val2=5000
res=val1/val2 ----> 1.2---> Round to 2
Please help.
Bad answer. Omit this post.
EDIT:
Did you thank it? Then I will re-write my original post, but it wasn't what you are looking for, it outputs a decimal number, without ceiling.
$ echo "scale=1; $val1 / $val2" | bc
1.2
Regards,
Birei
Thank you. How to round of the output to 2 here??
Multiple posts of same type ..