c# - Rounding a number with special conditions -
i need create function rounds numbers this:
33120->34000
21001->22000
here no decimal points if there exist number other 1 in last 3 digits 4th digit must incremented , last 3 digits should set 0.
i need optimized, don't want traverse each digit of each number since have on 800,000 number.
thanks in advance!
var result = math.ceiling((double) x/1000)*1000;