ali
ali

Reputation: 969

Round integer to nearest thousand

Is there a way to round int number

73400 -> 73000

and

73500 -> 74000

Upvotes: 1

Views: 1022

Answers (1)

Joris Kinable
Joris Kinable

Reputation: 2411

int number = 73400
return round(number/1000.0)*1000

Upvotes: 1

Related Questions