Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] to round off a decimal value

Expand Messages
  • Mr. Shawn H. Corey
    ... #!/usr/bin/perl use strict; use warnings; use POSIX; print ceil( 2.1333 ), n ; print ceil( 2.6666 ), n ; # See `perldoc POSIX` for details -- __END__
    Message 1 of 6 , Mar 29, 2006
    • 0 Attachment
      On Wed, 2006-29-03 at 07:25 +0000, joshypy wrote:
      > Dear friends,
      >
      > Could anyone tell me the function to convert a number with decimal
      > value to a number without decimal value.
      >
      >
      > that is to convert a value 2.1333 to 2, 2.6666 to 3, etc
      >
      >
      > thanking you
      >
      > Joshy

      #!/usr/bin/perl

      use strict;
      use warnings;

      use POSIX;

      print ceil( 2.1333 ), "\n";
      print ceil( 2.6666 ), "\n";

      # See `perldoc POSIX` for details
      --
      __END__

      Just my 0.00000002 million dollars worth,
      --- Shawn

      "For the things we have to learn before we can do them,
      we learn by doing them."
      Aristotle

      * Perl tutorials at http://perlmonks.org/?node=Tutorials
      * A searchable perldoc is at http://perldoc.perl.org/
    Your message has been successfully submitted and would be delivered to recipients shortly.