musl/src/stdlib/gcvt.c
Rich Felker f4ad36c4bf add deprecated (removed from posix) [efg]cvt() functions
these have not been heavily tested, but they should work as described
in the old standards. probably broken for non-finite values...
2012-02-06 01:14:23 -05:00

9 lines
119 B
C

#include <stdlib.h>
#include <stdio.h>
char *gcvt(double x, int n, char *b)
{
sprintf(b, "%.*g", n, x);
return b;
}