help with ftoa function

hiii every buddy ... im only trying to get afloat number whom im sending with xbee ... i need this number for math matical analysis after that /// so far im able to get the number into char array after that im using the ftoa func. so i can work with the number ... but im not using this func. probaply it returns 0 all the time ... so if any one can tell me what is the right thing to do here is my code :
#include <stdlib.h>
String readString;

void setup() {
Serial.begin(9600);
}

void loop() {

while (Serial.available()) {
delay(10);

char c = Serial.read(); //gets one byte from serial buffer
readString += c;} //makes the string readString

if (readString.length() >0) {
Serial.println(readString);
double n=0;

char carray[6];
readString.toCharArray(carray, sizeof(carray));
ftoa(carray,n,2);

Serial.println(carray);

readString="";
}
}

char *ftoa(char *a, double f, int precision)
{
long p[] = {0,10,100,1000,10000,100000,1000000,10000000,100000000};

char *ret = a;
long heiltal = (long)f;
itoa(heiltal, a, 10);
while (*a != '\0') a++;
*a++ = '.';
long desimal = abs((long)((f - heiltal) * p[precision]));
itoa(desimal, a, 10);
Serial.println(ret);
return ret;
}

so far im able to get the number into char array after that im using the ftoa func

ftoa is float to ascii. You have an ascii string that you want to create a float from. So, you want a atof() function (ascii to float). Fortunately, one already exists. Just use it.

it works good thanks alotttt/// i have another question ... if im sending 2 numbers and iwant to save them in defferent variables what technic do u recomend ?? send a end of packet marker between them or i need to focus in the receiver side ???

if im sending 2 numbers and iwant to save them in defferent variables what technic do u recomend ?? send a end of packet marker between them or i need to focus in the receiver side ???

Whatever the sender does, the receiver has to undo. So, if you send a string like "<123,456>" that has start (<) and end (>) markers, you still need to make the receiver parse the resulting relevant data (123,456) using strtok(), most likely.