www.pudn.com > 外挂硬盘和FLASH的MP3方案程序下载.rar > WORD2CHAR.C


#ifndef _COMMON_DEFINE 
 #include "COMMON.c" 
#endif 
 
void WORD2CHAR(WORD in,CHAR *out,BYTE l); 
void WORD2CHAR(WORD in,CHAR *out,BYTE l) 
{ 
	data BYTE temp,i; 
	bit f=0; 
	i=0; 
	if (in>9999) 
	{ 
	 	temp=in/10000; 
		in-=(temp*10000); 
		if (l>4) {out[i++]=temp+48;f=1;} 
	} 
	else 
		if (l>4) out[i++] = f ? '0' : ' '; 
 
	if (in>999) 
	{ 
	 	temp=in/1000; 
		in-=(temp*1000); 
		if (l>3) {out[i++]=temp+48;f=1;} 
		printf("%bd\n",i); 
	} 
	else 
		if (l>3) out[i++] = f ? '0' : ' '; 
 
	if (in>99) 
	{ 
	 	temp=in/100; 
		in-=(temp*100); 
		if (l>2) {out[i++]=temp+48;f=1;} 
	} 
	else 
		if (l>2) out[i++] = f ? '0' : ' '; 
 
	if (in>9) 
	{ 
	 	temp=in/10; 
		in-=(temp*10); 
		if (l>1) {out[i++]=temp+48;f=1;} 
	} 
	else 
		if (l>1) out[i++] = f ? '0' : ' '; 
	 
	temp=in; 
	out[i++]=temp+48; 
	out[i]=0; 
}