home *** CD-ROM | disk | FTP | other *** search
- /*--------------------------------------*/
- /* */
- /* FTOA(X,X,X) */
- /* */
- /* Converts a floating point number to */
- /* a character array. The first */
- /* argument is the floating point */
- /* number. The second argument is the */
- /* character array and the third */
- /* argument is the size of the array. */
- /* */
- /*--------------------------------------*/
- # include "math.h"
- void ftoa(dd,a,b)
- double dd;
- char a[];
- int b;
- {
- char *r;
- int d,j;
- gcvt(dd,b,r);
- d=strlen(r);
- if (d<b){
- charinit(a,b-d,32);
- for (j=b-d;j<b;j++)
- a[j]=r[j-b+d];
- }
- else{
- for (j=0;j<b;j++)
- a[j]=r[j];
- }
- }