home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
psform.zip
/
REGIST.SPE
< prev
next >
Wrap
Text File
|
1995-04-21
|
1KB
|
59 lines
/**********************************************/
/* Druckspezifikationen für Registration Form */
/**********************************************/
9,1,Date
9,2,Qu,r
9,3,M
9,4,name
9,5,userid
9,6,company
9,7,address_1
9,8,address_2
9,9,city
9,10,country
9,11,comments_1
9,12,comments_2
9,13,comments_3
9,14,comments_4
3,"f_amount( f_index2(3), f_index2(2) )",Amount,r
/*Funktionswert Rechnungsbetrag mit 2 Kommastellen in Stringform*/
/*als Funktion von Anzahl u. Währung */
/* Anzahl: String mit 4 Stellen, Währung: String mit 3 Stellen */
Funktionen=
[
char *f_amount(char *currency, char *quantity)
{
int q;
int faktor = 0;
int us = 20;
int dm = 25;
char ergebnis[6];
if ( strlen(currency) < 4 ) {
if ( strcmp(currency, "DM") == 0 ) {
faktor = dm;
} else {
if ( strcmp(currency, "US$") == 0 ) {
faktor = us;
} else {
printf("Falsche Währungsangabe ! / Wrong currency ! \n");
strcpy( ergebnis, NULL);
}
}
if ( strlen(quantity) < 3 ) {
q = atoi(quantity);
q = q * faktor;
itoa(q, ergebnis, 10);
} else {
printf("Falsche Währungsangabe ! / Wrong currency !\n");
strcpy( ergebnis, NULL);
}
} else {
printf("Falsche Währungsangabe ! / Wrong currency !\n");
strcpy( ergebnis, NULL);
}
return ergebnis;
}
]