Perl trivia question
Joel Meulenberg
joelmeulenberg at yahoo.com
Wed Feb 16 19:53:47 CST 2000
> if($v>int($v)){$v=int($v)+1;}
Just one quick suggestion: If you're working with negative numbers,
you may want to change it to:
if($v != int($v)){$v=int($v)+1;}
--- "Siner, Rick" <Rick.Siner at priority-health.com> wrote:
> One brute force alternative would be
> if($v>int($v)){$v=int($v)+1;}
>
> I'm sure someone else might have a more elegant alternative.....
>
>
> -----Original Message-----
> From: Del Nicholls [mailto:dln at gilsongfx.com]
> Sent: Wednesday, February 16, 2000 4:56 PM
> To: GR List Perl
> Subject: Perl trivia question
>
>
> Hello all,
>
> Thanks to Joel M. for help with the following line,
>
> $text_in =~ s/zzz(\d+)/"\n".($1)."\n Euro ".(sprintf("%.2f", $1 \/
> $cfeu))."\n"/ge;
>
> Stuffing all that in one line is so cool.
>
> I have another detail I haven't been able to find. In Excel you can
> specify
> a "ceiling" (all fractional parts of "1" round up to the next whole
> number.
> Does that function exist in Perl?
>
> For example:
> 1.0 stays 1.0
> 1.1 goes to 2.0
> 1.9 goes to 2.0
> 2.0 stays 2.0
>
> Thanks,
>
> Del Nicholls
> Xyvision Manager
> Gilson Graphics
> Grand Rapids
>
>
>
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
More information about the grand-rapids-pm-list
mailing list