Perl trivia question

Siner, Rick Rick.Siner at priority-health.com
Wed Feb 16 17:05:42 CST 2000


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



More information about the grand-rapids-pm-list mailing list