scala replace if else with state pattern : here is my if statement code in scala:

    def handle(): Unit = {
        if (calculator.num == 0.0){
            calculator.num = number
          }
        else{
            calculator.num = calculator.num * 10 + number
          }
        }


How do I replace the if else with state pattern?