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

AW: [PBML] to round off a decimal value

Expand Messages
  • Lange Gunter, CH
    one way is to use formatted output with printf: my $nbr1= 2.1333; my $nbr2= 2.6666; printf ( nbr1=%.0f, nbr2=%.0f n , $nbr1, $nbr2); gl ... Von:
    Message 1 of 1 , Mar 29, 2006
    View Source
    • 0 Attachment
      one way is to use formatted output with printf:

      my $nbr1= 2.1333;
      my $nbr2= 2.6666;

      printf ("nbr1=%.0f, nbr2=%.0f\n", $nbr1, $nbr2);

      gl


      -----Ursprüngliche Nachricht-----
      Von: perl-beginner@yahoogroups.com [mailto:perl-beginner@yahoogroups.com] Im
      Auftrag von joshypy
      Gesendet: Mittwoch, 29. März 2006 09:25
      An: perl-beginner@yahoogroups.com
      Betreff: [PBML] to round off a decimal value


      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








      Unsubscribing info is here:
      http://help.yahoo.com/help/us/groups/groups-32.html
      Yahoo! Groups Links
    Your message has been successfully submitted and would be delivered to recipients shortly.