Round(3.5) = 3?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mohanarun
    New Member
    • Apr 2009
    • 1

    Round(3.5) = 3?

    Hi I am confused, I am getting ROUND(4.5) = 4 in classic ASP, I want .5 and above to be rounded to the next higher number. Any way to achive?
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    Right, if you round all .5s up you can introduce bias over time, so ASP follows the statistical practice of rounding to the nearest even number, and there isn't an alternative. You will need to write your own function to handle rounding. I found this discussion with sample code to work around the problem. Note, this is not entirely ASP code, there is some discussion of RhinoScript, and I didn't read into it deeply enough to tell exactly what they were trying to say, but there are ASP solutions on that page. Let me know if this helps.

    Jared

    Comment

    Working...