How would I round a number to the nearest multiple of 10?

Recommended Answers

All 2 Replies

How about this: RoundedN = 10*int(round(N/10.0)) , where N can be integer or floating

commented: simple and to the point +12

Thanks! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.