Noggenfogger
April 23rd, 2008, 09:37 AM
Hi
I'm looking for a way to round off numbers upwards using shell script.
examples:
1400/512 using bc or expr will return 2.
I want it to always roundoff upwards not down, so in this case i need it to return 3.
1024/512 must generate 2, that don't need to be rounded off since it's divided into 2 exactly.
hope you understand what I'm looking for
Anyone know how to do this?
(sorry for my poor english)
I'm looking for a way to round off numbers upwards using shell script.
examples:
1400/512 using bc or expr will return 2.
I want it to always roundoff upwards not down, so in this case i need it to return 3.
1024/512 must generate 2, that don't need to be rounded off since it's divided into 2 exactly.
hope you understand what I'm looking for
Anyone know how to do this?
(sorry for my poor english)