From: matze Date: Sun, 29 Jul 2007 00:42:16 +0000 (+0000) Subject: format_euro(123) => "1,23EUR" X-Git-Tag: rgb2rv6~74 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6ecbaa8a1e29b6e3cac806b375f4d7cc137dbc78;p=c128-kasse format_euro(123) => "1,23EUR" git-svn-id: https://shell.noname-ev.de/svn/kasse/c128@35 af93e077-1a23-4f1e-9cbe-9382a9d578f5 --- diff --git a/general.c b/general.c index 1b99373..9f0c6c6 100644 --- a/general.c +++ b/general.c @@ -29,6 +29,11 @@ char *get_input() { return output; } +char * format_euro(char * s, int cent){ + sprintf(s, "%d,%dEUR", cent/100, cent%100); + return s; +} + void c128_perror(BYTE c, char *msg) { printf("\nError (Code %d) while: %s\nOS Error = %s\n", c, msg, _oserror); } diff --git a/general.h b/general.h index 81afdf4..1a607f1 100644 --- a/general.h +++ b/general.h @@ -2,6 +2,7 @@ #define GENERAL_H_ typedef unsigned char BYTE; char *get_input(); +char * format_euro(char * s, int cent); void c128_perror(BYTE, char*); extern BYTE _oserror; #endif /*GENERAL_H_*/