#Java 7, 116 76 bytes
Java 7, 116 76 bytes
int c(int i){int r=(int)Math.pow(10,(i+"").length())/9;return(-i/r-1)*-r-i;}
Used @Dennis' amazing approach to lower the byte-count by a whopping 40 bytes.
Ungolfed & test cases:
class Main{
static int c(int i){
int r = (int)Math.pow(10, (i+"").length()) / 9;
return (-i / r - 1) * -r - i;
}
public static void main(String[] a){
System.out.println(c(8));
System.out.println(c(100));
System.out.println(c(113));
System.out.println(c(87654321));
System.out.println(c(42));
System.out.println(c(20000));
System.out.println(c(11132));
}
}
Output:
0
11
109
1234567
2
2222
11090