Apr 23, 2004 #1 bgreen Programmer Feb 20, 2003 185 CA I want to be able to pass in the variable diff into the fprintf statement where the number 87 is. How do I do this? diff = dollar - cent; POS(.25); fprintf(fd, "%.87s --\r\n", cheque.sp_amount);
I want to be able to pass in the variable diff into the fprintf statement where the number 87 is. How do I do this? diff = dollar - cent; POS(.25); fprintf(fd, "%.87s --\r\n", cheque.sp_amount);
Apr 25, 2004 #2 xwb Programmer Jul 11, 2002 6,828 GB Code: fprintf (fd, "%.2f -- \n", diff); Not sure what the other bits of your pseudo code are Upvote 0 Downvote
Apr 26, 2004 Thread starter #3 bgreen Programmer Feb 20, 2003 185 CA I want to pass in diff where the 87 is. I need to keep the %s in for the cheque spelling amount. ex. fprintf(fd, "%.%ds --\r\n", diff, cheque.sp_amount); %d = 87 Upvote 0 Downvote
I want to pass in diff where the 87 is. I need to keep the %s in for the cheque spelling amount. ex. fprintf(fd, "%.%ds --\r\n", diff, cheque.sp_amount); %d = 87
Apr 26, 2004 #4 xwb Programmer Jul 11, 2002 6,828 GB Almost right Code: fprintf(fd, "%.2f %s --\r\n", diff, cheque.sp_amount); Assuming diff is a float. Alternatively Code: fprintf(fd, "%d %s --\r\n", diff, cheque.sp_amount); if diff is an integer Upvote 0 Downvote
Almost right Code: fprintf(fd, "%.2f %s --\r\n", diff, cheque.sp_amount); Assuming diff is a float. Alternatively Code: fprintf(fd, "%d %s --\r\n", diff, cheque.sp_amount); if diff is an integer