Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Round a fraction

by frankus (Priest)
on Aug 02, 2002 at 14:45 UTC ( #187106=note: print w/ replies, xml ) Need Help??


in reply to Round a fraction

Okay, I am definitely missing something here...

If not, why not just use sprintf

like perl -e 'printf("%0.5f",1.233394494955);
So what did I miss?

--

Brother Frankus.

¤


Comment on Re: Round a fraction
Select or Download Code
Re: Re: Round a fraction
by fglock (Vicar) on Aug 02, 2002 at 14:55 UTC

    I want to round a number, keeping as many digits as possible, if the number ends in /999.$/ .

    So I'd need something like a "%0.(max)f" format (maybe it exists?)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://187106]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2015-07-06 10:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (71 votes), past polls