All pastes #261906 Raw Edit

Sans nom

public cpp v1 · immutable
#261906 ·published 2006-11-29 23:19 UTC
rendered paste body
char * convert_to_string(long double resultat, OPTIONS & opt){	char * msg = new char [RESULT];	char pre[8];	snprintf(pre, 8, "%%.%dLf", opt.nb_chiffres);	if(opt.type == AUTO)	{			if((int) resultat == resultat)			{				snprintf (msg, RESULT, "%.0Lf", resultat);			}			else			{				snprintf(pre, 8, "%%.%dLe", opt.nb_chiffres);				snprintf (msg, RESULT, pre, resultat);			}	}	else if(opt.type == EXPO)	{		snprintf(pre, 8, "%%.%dLe", opt.nb_chiffres);		snprintf (msg, RESULT, pre, resultat);	}	else	{		snprintf(pre, 8, "%%.%dLf", opt.nb_chiffres);		snprintf (msg, RESULT, pre, resultat);	}	return msg;}