Find the answer to your Linux question:
Results 1 to 3 of 3
I want to do some integer in round figure Ex. 99.777777777777777777777 to 100 99.444444444444 to 99 but I am using perl old version so can't use use Number::Format; and I ...
  1. #1
    Linux Newbie
    Join Date
    Jan 2008
    Posts
    114

    How to do round figure 99.777777777777777777777 to 100 in perl

    I want to do some integer in round figure

    Ex. 99.777777777777777777777 to 100
    99.444444444444 to 99

    but I am using perl old version so can't use

    use Number::Format;

    and I can't install latest version of perl on server, not in my control.

    Please help me.

    Thanks-

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Code:
    $xxx=int($xxx+0.5);
    Hope this helps.
    --
    Bill

    Old age and treachery will overcome youth and skill.

  3. #3
    Linux Newbie
    Join Date
    Jan 2008
    Posts
    114
    Thanks, it works!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...