Can't read float from file with fscanf()

Hi,
I’m using LittleFileSystem and want to write and read a float from a txt file.

FILE *f = fopen("/fs/numbers.txt", "r+");
float number = 12.12f;
// Store number
fprintf(f, "%f\n", number);
 fflush(f);
// close file and reopen
float c;
    while (!feof(f)) {
        fscanf(f, "%f\n", &c);
        printf("number: %f", c);
    }

But I couldn’t get float c’s value from file, in terminal I only got this:

numbers:

I wonder why float value can’t be read correctly

Hello,

Maybe there is not problem with read but with write, try to look at this - mbed-os/platform/source/minimal-printf at master · ARMmbed/mbed-os · GitHub

BR, Jan