Server IP : 68.65.122.142  /  Your IP : 3.141.19.235
Web Server : LiteSpeed
System : Linux server167.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User : glenirhm ( 1318)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/locale/bo/../ur_PK/../uz/../dak/../bg/../lol/../tem/../ast/../km_KH/../nds/../kw/../wo/../ca/../tzo/../tzm/../nyn/../io/../gil/../elx/../zh-Hans/../mus/../ko/../hai/../sq/../de/../nso/../wa/../pa/../dv/../tai/../alt/../es_CL/../tg/../ty/../gom/../../awk/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/locale/bo/../ur_PK/../uz/../dak/../bg/../lol/../tem/../ast/../km_KH/../nds/../kw/../wo/../ca/../tzo/../tzm/../nyn/../io/../gil/../elx/../zh-Hans/../mus/../ko/../hai/../sq/../de/../nso/../wa/../pa/../dv/../tai/../alt/../es_CL/../tg/../ty/../gom/../../awk/round.awk
# round.awk --- do normal rounding
#
# Arnold Robbins, arnold@skeeve.com, Public Domain
# August, 1996

function round(x,   ival, aval, fraction)
{
   ival = int(x)    # integer part, int() truncates

   # see if fractional part
   if (ival == x)   # no fraction
      return ival   # ensure no decimals

   if (x < 0) {
      aval = -x     # absolute value
      ival = int(aval)
      fraction = aval - ival
      if (fraction >= .5)
         return int(x) - 1   # -2.5 --> -3
      else
         return int(x)       # -2.3 --> -2
   } else {
      fraction = x - ival
      if (fraction >= .5)
         return ival + 1
      else
         return ival
   }
}