# Thread: Round down to nearest 1000

1. ## Round down to nearest 1000

Hi guys

I need to round down a value in my string <%=mileage%> to the nearest 1000. However, I need the output to only show a single digit:

So,

400 = 0
800 = 0
1200 = 1
1800 = 1
2000 = 2
2400 = 2
2600 = 2
3000 = 3
3500 = 3
3985 = 3
4544 = 4
etc
etc
45000 = 45
45600 = 45
49200 = 49
etc
etc
105000 = 105
105400 = 105

Is this at all possible? If so, how is it done?

Any help would be fully appreciated

Best regards

Rod from the UK

2. I think all you need is

Code:
`<%=mileage / 1000 %>`

3. Thanks ParkingT

Nearly. I just needed to divide by 1000 and then turn it into an integer (round)

Best regards

Rod from the UK

4. What result does Round(800/1000) give?

I'll save you checking - it is 1. So it doesn't give the result you stated you wanted (0). Int or Fix give you the correct answer.

Code:
```<% =Round(800/1000) %>
<% =Int(800/1000) %>
<% =Fix(800/1000) %>```

5. Excellent - thanks Ian

Best regards

Rod from the UK

#### Posting Permissions

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