Due to server problems the website is temporarily offline! Visit http://www.smorgasbordet.com/pellesc/ to download Pelles C.
char *ecvt1(double value, int ndigit, int *decpt, int *sign) { static char buffer[348]; static const int n = sizeof(buffer)/sizeof(buffer[0])-1; ptrdiff_t pd; int len; int zeros=0; if (ndigit > n) ndigit=n; while (value > -1.0 && value < 1.0 ) { value*=10.0; zeros++; } sprintf(buffer,"%.*f",DBL_DIG,value); len=strlen(buffer); if (buffer[0]=='-') { memmove(buffer, buffer+1, --len); buffer[len]='\0'; *sign=1; } else *sign = 0; pd=strchr(buffer,'.')-buffer; memmove(buffer+pd,buffer+pd+1,--len-pd); buffer[len]='\0'; *decpt=(int)pd-zeros; if (len >= ndigit) buffer[ndigit]='\0'; else { memset(buffer+len,'0',ndigit-len); buffer[ndigit]='\0'; } return buffer;}
;crtdll_ecvt.defLIBRARY crtdllEXPORTS_ecvt