Should be:

if(dv > 9) {
    dv = 0;
}

(except with tabs instead of spaces)