#include <stdio.h>;
#include <stdlib.h>;
char *floatToString(double fZ,const int slen,const int alen);
main(int argc,char *argv[])
{
fprintf(stdout,"[%s]\n",floatToString(atof(argv[1]), atoi(argv[2]), atoi(argv[3])));
return;
}
char *floatToString(double fZ,const int slen,const int alen)
{
char tmpstr[256];
memset(tmpstr,'\0',256);
sprintf(tmpstr,"%*.*lf",slen,alen,fZ); //-- 这里控制精度
return(tmpstr);
}