Jan 30, 2015
04:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 30, 2015
04:28 PM
While receiving UART commands, I need to convert strings to numerical values. For example, string "1.23" would produce float number 1.23 using function 'atof()':
V=atof('1.23…');
Unfortunately, in the case of a typo this function will return a valid number also ("0"), which will be passed to the program. For example:
atof('1.$23…')=0, ($ is a typo)
Is there any built-in function to check for valid input number?
regards,
odissey1
11 Replies