Hi,

How can I round down an int number in c++?

What I want to do is basically round down a number, for instance I know that the my numbers are always going to be 5 digit long, but I want them to be rounded down as follow.

If----------Round down to

25335 = 25000

26458 = 26000

50465 = 50000

etc...

I tried floor(value) but I think this is just for floats.

How do I do this in c++?

Thanks a lot

How can I round down an int number in c++?

What I want to do is basically round down a number, for instance I know that the my numbers are always going to be 5 digit long, but I want them to be rounded down as follow.

If----------Round down to

25335 = 25000

26458 = 26000

50465 = 50000

etc...

I tried floor(value) but I think this is just for floats.

How do I do this in c++?

Thanks a lot

kbw --> This is for rounding, not rounding down,

just divide by 1000 and multiply by 1000

just divide by 1000 and multiply by 1000

You guys are awesome! Thanks a lot. I'm always amazed about how quick you guys find the solution.

Anomen - That's exactly what I found out after trying what kbw suggested, thank you for clarifying this.

Thanks a lot

Anomen - That's exactly what I found out after trying what kbw suggested, thank you for clarifying this.

Thanks a lot

Topic archived. No new replies allowed.