Completed the number function according to the flowchart.