Another way would be to "save" the incoming information in a "number" variable using float() at worst to cast the value as a floating value.
This will directly set the value of the variable to a number and will prevent you having to do any string manipulation.
That works best This will come in Handy, i thoght that would make an error, but it work.