Blog
Developers
Careers
Support
Contact
Gossamer Threads
Solutions
Results
About
Mailing Lists
Resource Centre
Forum
Tools
Home
Who's Online
Tags
Favourites
Login
Forum Search
(
Advanced Search
)
This forum
This category
All forums
for
Home
:
General
:
Perl Programming
:
General: Perl Programming: Re: [zeshan] rounding the figures: Edit Log
Here is the list of edits for this post
Apr 29, 2003, 2:33 PM
Paul
Veteran
(19537 posts)
Apr 29, 2003, 2:33 PM
Views: 4495
Re: [zeshan] rounding the figures
Code:
my $rounded = int($line + .5);
Or to work with negative numbers also:
Code:
my $rounded = int($line + .5 * ($line <=> 0));
Last
edited
by:
Paul
: Apr 29, 2003, 2:34 PM
Edit Log:
Post edited by
Paul
Post edited by
Paul
(Veteran) on Apr 29, 2003, 2:34 PM