Just curious, did somebody here used sprintf and floats successfully?

Using
  float value;
  char s[20];
  sprintf(s,"%f", value);
I get
 main.c:329: warning: double format, float arg (arg 3)
and it prints something like "ff".

Only 8byte-floats are in the standard for ..printf. Mspgcc
only support 4byte-floats; so now way to use %f? Or is there some
modifier that tell printf the argument is 4byte-float?

(However I have my own routines for float2string, I am just interested).

Happy Easter!

M.

Reply via email to