No need for the second variable, just use $calc(($ticks - %ticks) / 1000)