Friday, August 12, 2011

How to Round in a linux command?

Linux has a built-in command for rounding numbers. It's using the "printf" functionality.

Below are the examples:

$printf "%.0f\n" "69.51"
69

$printf "%.0f\n" "69.41"
68