PDA

View Full Version : SpinCode for Float string to internal conversion ?



Paul Rowntree
01-12-2009, 01:10 AM
Greetings All;
I have prowled the ObEx and std libraries, but I cannot find a routine to convert an ASCII string to a floating point value compatible with the Float32 etc codes. Am I missing something? The header of FloatString suggests that it converts both ways, but no such luck.

I am most certainly missing something obvious, but a push in the right direction would be much appreciated.

Cheers!
Paul Rowntree

Mike Green
01-12-2009, 01:38 AM
You're not missing anything. I think there have been examples posted in forum messages, but I don't have any links. I believe I posted one some time ago that would handle digits and a decimal point, but no exponential specification (E+00 or E-00).

Mike Green
01-12-2009, 01:50 AM
A simple search with <search.parallax.com> found one example: http://forums.parallax.com/showthread.php?p=689666

Paul Rowntree
01-12-2009, 04:45 AM
Thanks Mike; I will build up from this.

Cheers!
Paul Rowntree