Rounding

1. Member
Join Date
Dec 1969
Posts
48

## Rounding

Question, <BR><BR>How come when i use CInt to round a number i get the wrong value back. <BR><BR>I.E. <BR>i = rs.recordcount / 2<BR>response.write(CInt(i))<BR><BR>the recordcount at this moment is 9, so dividing by 2 returns 4.5, then the CInt(i) expression should return a value of 5, however it returns a value of 4. <BR><BR>why is this?<BR><BR>Thanks in advance

2. Leo
Senior Member
Join Date
Dec 1969
Posts
1,019

## RE: Rounding

Don&#039t know why it returns 4 instead of 4.5 but a solution is to use the Round function instead.

3. Senior Member
Join Date
Dec 1969
Posts
915

## RE: Rounding

Try using the following...<BR><BR>i = FormatNumber((9/ 2), 0)<BR>response.write(i)<BR><BR>the 1 in the FormatNumber Function is the number of decimals.<BR><BR>HTH<BR><BR>Jerry<BR><BR><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
•