Rounding up...

Results 1 to 3 of 3

Thread: Rounding up...

  1. #1
    Join Date
    Dec 1969

    Default Rounding up...

    I am paging rcords and want to show the number of pages in the recordset. So if I have 164 records I want to say page 1 of 17<BR><BR>Is there a VBScript way to round up (like Ceiling in JavaScript)?

  2. #2
    Join Date
    Dec 1969

    Default RE: Rounding up...

    Have a look at the FAQ&#039;s above on this page and look under Math.

  3. #3
    Join Date
    Dec 1969

    Default Wrong answer...

    That FAQ tells you how to round *TO* a certain number, but that&#039;s not the same thing.<BR><BR>How about:<BR><BR>&#060;%<BR>Function RoundUp( n )<BR>&nbsp; &nbsp; If n &#060;&#062; Int(n) Then n = Int(n)<BR>&nbsp; &nbsp; RoundUp = n <BR>End Function<BR>%&#062;<BR><BR>So, for the example given: <BR><BR>&#060;%<BR>numberOfPages = RoundUp( 164 / 10 )<BR>%&#062;<BR><BR>

Posting Permissions

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