[Bioperl-l] perl question

Marc Logghe Marc.Logghe at DEVGEN.com
Mon Nov 5 12:39:36 UTC 2007


Hi,
Have a look at
http://perldoc.perl.org/functions/sprintf.html#precision%2c-or-maximum-w
idth

In your particular case:
my $f = 3.1232010098;
printf "%0.3f", $f;


HTH,
Marc
 

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org 
> [mailto:bioperl-l-bounces at lists.open-bio.org] On Behalf Of 
> neeti somaiya
> Sent: Monday, November 05, 2007 1:20 PM
> To: bioperl-l
> Subject: [Bioperl-l] perl question
> 
> Again a perl question, and maybe a very trivial one.
> How do I terminate a number like 3.1232010098 to only 3 
> decimal places in perl?
> 
> --
> -Neeti
> Even my blood says, B positive
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 
> 




More information about the Bioperl-l mailing list