>>292 自分で削ってやるしかない。こんなの書いてみたがいかがか。
#include <stdio.h>
#include <string.h>
#include <ctype.h>
char *FloatToChar(char *buf, char width, double d)
{
char *base = buf, *p;
sprintf(base, "%.*f", width, d);
while(isdigit(*base))
base++;
if(*buf == '.')
base++;
p = base;
if(*base == '0')
base++;
while(*p)
p++;
while(--p >= base)
{
if(*p == '0')
*p = '\0';
else
break;
}
return buf;
}
int main(void)
{
char buf[256];
printf("%s\n", FloatToChar(buf, 10, 123.45));
return 0;
}