Thread: correctly round in bash
10 divided 6 1.67, should rounded 2, bash rounds numbers down.
example:will output 1.php code:
echo $((10/6))
how solved?
appreciated.
so there implicit floor() in (10/6)? in case: $((10/6) + 0.5) ought do.
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk correctly round in bash
Ubuntu
Comments
Post a Comment