]> git.sur5r.net Git - c128-kasse/blobdiff - src/general.c
Merge pull request #37 from sur5r/issue36
[c128-kasse] / src / general.c
index 537c833aeb2348591fb9b5988b397c2d7175e6ec..10d715d62a0c4698079fa82db7b8fb32b0f04371 100644 (file)
@@ -215,8 +215,11 @@ char retry_or_quit(void) {
   return *c;
 }
 
-char *format_euro(char *s, int maxlen, int cent) {
-  if (snprintf(s, maxlen, EUR_FORMAT, cent / 100, cent % 100) > maxlen)
+char *format_euro(char *s, int maxlen, int32_t cent) {
+  int32_t euros, cents;
+  euros = cent / 100;
+  cents = abs(cent % 100);
+  if (snprintf(s, maxlen, EUR_FORMAT, euros, cents) > maxlen)
     return NULL;
   return s;
 }