Convert float to strint to use "WriteToFile(var)"

I am new to arduino and I want to write a .txt on an sd card. Writing text works fine. I am using " writeToFile("Blablabla"); " Next I want to give out a float value. This doesn't work however.

If I want to use "writeToFile(var)" again, I need to change the var type to char or string. I have been googleing for two hours, but I didn't find anything that was of help. Usually the answers create more questions than they solve. Since I have hardly ANY coding experince, it would be nice, if you could keep it simple. Shouldn't be too hard after all... Seems to be a basic problem.

Thans in advance for any effort!

dtostrf is the function.

I'm not sure what you are reallly trying to do, and I have never heard of Writetofile(var), but plain old
myFile.print(floatvar); works fine, keeps it simple, and is probably all you need.

dtostrf worked for me! :slight_smile: