Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Question:

by Anonymous Monk
on Mar 13, 2002 at 20:50 UTC ( #151520=note: print w/replies, xml ) Need Help??

in reply to Question:
in thread Using (s)printf()

Use split() to get rid of it.

Replies are listed 'Best First'.
Re: Re: Question:
by Anonymous Monk on Jun 25, 2002 at 18:23 UTC
    sub _round {
    my $digits = shift;
    my $num = shift;

    my $add = 5 * (10 ** -($digits + 1));

    $num += $add;

    my ($int,$frac) = split /\./,$num;

    $frac = substr($frac, 0, $digits);

    $num = join '.', $int, $frac;

    return $num;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://151520]
[ww]: ++ all (phony labels re "gaming"
[1nickt]: ambrus perhaps you know where the keys are?
[ww]: OTOH, -- for ads suggesting that being good at games is somehow eq "greatness"
[ambrus]: 1nickg: obviously the gamers don't know. but anyway, I need the whole room backlit, because watching a monitor in a dark room (like many people do) is tiring for my eyes, even more so than doing it in a lit room.

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (18)
As of 2017-03-27 13:55 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (320 votes). Check out past polls.