char array to float

I’m recieving serial data from a GPS device but some example programs I’ve been using stores the data as an array of characters. I need to do some math on these numbers, is there a way to convert these values back to decimals and store them as a float or double?

SEE:

ASCII to INTEGER ATOI() INTEGER to ASCII ITOA() ASCII to FLOAT ATOF()

atof() works very nicely but it rounds off some information.

For example when I print out the string of characters and then print out the float after that atof() I get the following difference

3802.1337

3802.13

is there a way to stop this rounding?

You could write your own float print method.

The atof does not round, but the print does. So if your main concern is to use the floats in math - you should be ok.