Rounding Numbers

C

C

Hi,

I have some logic that rounds decimal numbers

E.g

Math.Round(26579.80)

This gives
26580

However I want to get the nearest thousand which should
give
27000

How can I do this?

Thanks,
C
 
F

Frank Drebin

Take the original number, divide by 1000 - then round that number... then
multiply by 1000..

A) 26580 / 1000 = 26.58
B) 26.58 rounded = 27
C) 27 * 1000 = 27000

What do you think?
 
C

C

Thanks for your reply.

I am adding a series of numbers that are like 200,1243.42

I then want to round to the nearest thousand?

Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top