blob: 3c27b62c44730e9476e8b9bbbf9b31d8817fdbf7 [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001#include <stdio.h>
2#include <stdlib.h>
3
4
5#ifdef __UCLIBC_HAS_FLOATS__
6#define MAX_NDIGIT 17
7char *gcvt (double number, int ndigit, char *buf)
8{
9 sprintf(buf, "%.*g", (ndigit > MAX_NDIGIT)? MAX_NDIGIT : ndigit, number);
10 return buf;
11}
12#endif