The Ltoa function first converts a number into a corresponding string. If you don't know how to use this function, you can look it up online yourself.
Then judge whether this string has a decimal point, you can use the function strchr(str,'.'); If you don't know the usage, you can also look it up online.
As for automatically returning to the previous level, there is no good way to return to the previous level because you have written all the steps as a function. Although goto is used, it is not recommended. You should package each separable step into a function and then call these functions in the main function. This assembly is more formative and easy to debug.