Readers: 27
_tprintf(_T("%d "), fd.nFileSizeLow);
printf("%'d", (int)whatever);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
if(fd.nFileSizeLow==0)
{
_tprintf(_T("\t "));
i++;
}
else
{
int f = fd.nFileSizeLow/1000;
m++;
if(f > 1000)
{
m++;
f = f/1000;
printf("%d", f);
f = fd.nFileSizeLow/1000-1000*f;
printf(".%3d", f);
}
else printf("%5d", f);
int k=0;
if(k<=m && m>0)
{
k++;
int i = fd.nFileSizeLow%1000;
printf(".%03d ", i);
}
r++;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#include <stdio.h> #include <stdlib.h> #include <string.h> char *eur(double a); int main() { double a; char *b; a = 1234567.891011; b = eur(a); printf ("%s\n", b); return 0; } char *eur (double a) { int i; int l; int x; char *b; char *c; b = malloc(30); c = malloc(40); sprintf(b, "%.2f", a); l = strlen(b); x = 0; c += 40; *c = '\0'; for (i = l - 1; i >= 0; i--) { b += i; if (*b == '.') { *b = ','; } if (i < l - 3) { if (x % 3 == 0 && i < l - 4) { c--; *c = '.'; } x++; } c--; *c = *b; b -= i; } free(b); return c; }