number controlled by dragging slider

Does anyone know how I could achieve this slider animation using variables? How to change the number based on the drag interaction using variables. Thank you in advance.