in reply to Round a fraction

In the regexp I'd just look for By handling rounding in both directions you save yourself some trouble later on.

You didn't say, was it necessary to retain the tiny amount that you adjusted by? My suggestion doesn't keep that information -- I assumed it was irrelevant.

--t. alex

"Mud, mud, glorious mud. Nothing quite like it for cooling the blood!"
--Michael Flanders and Donald Swann

Replies are listed 'Best First'.
Re: Re: Round a fraction
by fglock (Vicar) on Aug 02, 2002 at 13:10 UTC

    was it necessary to retain the tiny amount that you adjusted by?

    No, that is just some quick hack.

    add one to the end

    Is there an easy way to do that? (besides using substr and x)