VBScript/ASP always round up

Hi, is there a way to make my numbers always round up, say i have 1.1, i want it to always round up to 2, anyone know of a way of doing this, as the Round() function seems to go up or down depending on the decimal.
LVL 4
LTY83Asked:
Who is Participating?
 
fritz_the_blankCommented:
Oops, that's not right. That should be:

function roundUp(numToRound)
  roundUp = Round(numToRound + .5)
end function

FtB

0
 
fritz_the_blankCommented:
You bet:

function roundUp(numToRound)
  roundUp = Int(numToRound + .5)
end function

FtB
0
 
fritz_the_blankCommented:
The idea is that anything above .5 will round up, anything below downwards. Adding .5 to the value will always force a round up.

FtB
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LTY83Author Commented:
wow, quick, easy, man why didn't i think of that, thanks again! :)
0
 
ClifCommented:
dim fNumber

fNumber = 1.1

fNewNumber = int(fNumber) + abs((fNumber - int(fNumber)) <> 0)

response.write(fNewNumber)
0
 
fritz_the_blankCommented:
Glad to have helped,

FtB
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.