Results 1 to 5 of 5

Thread: [resolved]Whole numbers and rounding up or down?

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2005
    Posts
    18

    Resolved [resolved]Whole numbers and rounding up or down?

    I've managed to get VB to create and calculate an 'offer' which will be calculated 4 or 5 times throughout the program. The 'offer' nearly always has a decimal place which i dont need, i just want a whole number returned and preferably rounded up or down to the nearest 100.

    I've tried:
    VB Code:
    1. offer = CStr(Left$(offer, 2)) & "00"

    but this only works with (say) 3,500 but not 35,000 - on the larger numbers it reduces them to 4 figures! but the random offer could be anywhere from 3 figures to 6 figures!


    This...
    VB Code:
    1. offer = Round(offer - 2)

    seems to work a bit better but will not give 'to the nearest 100' results.

    any idea how to get the best of both worlds!?
    Last edited by nick_roberts; Dec 11th, 2005 at 06:56 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width