After this validation, you can safely put string to System.Double.Parse and System.Single.Parse functions.