Dyslexic bloke, you are my hero for the day. I've been looking for this function and it works perfectly for sending acquired doubles over a radio, which is expecting a string / array.
Dyslexicbloke:
I am very new to all this but found that there are functions in the core library's that will 'format' a number and make a string.
Since strings are arrays, using dtostrf (DoubleToString formatted) you can go from 123.456 to [1],[2],[3],1. ,[4],[6],[\0] in 1 step.void TestCode(){
float iVarToCast = 123.456;
char buffer[7];
dtostrf(iVarToCast, 7, 0, buffer);
lcd.print(buffer);
}
dtostrf(YourNumber, TotalStringLength, NumberOfDecimals, TheTargetArray) TotalStringLength > Must include all characters the '.' and the null terminator NumberOfDecimals > The output is rounded .456 become .46 at 2 decimals TheTargetArray > I suspect 'char strBuffer[]' will work with out a preceding definition but I haven't tried yet Hope this helps Al [/quote]