This one time, at band camp, Andrew Wilson wrote:
>
>Hello all,
>Probably an easy one .. but its friday.. i have a headache and a spare copy for the 
>person that provides the answer.
>
>I have a script that is returning me number varibles with decimal places in them. 
>e.g
>
>129.384756%
>75.12872%
>
>What bash command would i use to round this above numbers to 2 decimal places.

hehe.

willow% echo '129.384756' | sed 's/^\([^\.]*\...\).*/\1/'
129.38

pipe your script into that sed program...

-- 
[EMAIL PROTECTED]                           http://spacepants.org/jaq.gpg
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to