Merge branch 'master' of https://secure.softndesign.org/git/calc
[calc.git] / format.c
index 77e3a18b3bfce0a8202a1d179b51c0aa042363da..60cb1d477e6055281b578070daf7cae63bfc75d0 100644 (file)
--- a/format.c
+++ b/format.c
@@ -76,11 +76,6 @@ void set_base (int in, int out)
     _obase = out;
 }
 
-int is_input_decimal ()
-{
-    return (_ibase == 10);
-}
-
 char *show_base ()
 {
     static char str[16] = {0};
@@ -93,7 +88,9 @@ int get_ibase ()
     return _ibase;
 }
 
-char *itoa (unsigned long value)
+/* multi base integer to ascii function */
+
+char *mbitoa (unsigned long value)
 {
     static char str[8 * sizeof (long) + 1];
 
@@ -121,7 +118,7 @@ double print (double value)
     if (_obase == 10) {
         printf (_format ? _format : DEFAULT_FORMAT, value);
     } else {
-        printf ("%s%s\n", (_prompt) ? _prompt : DEFAULT_PROMPT, itoa ((unsigned int)value));
+        printf ("%s%s\n", (_prompt) ? _prompt : DEFAULT_PROMPT, mbitoa ((unsigned int)value));
     }
     return value;
 }
@@ -131,7 +128,7 @@ double printl (double value)
     if (_obase == 10) {
         printf (_minform ? _minform : DEFAULT_MINFORM, value);
     } else {
-        printf ("%s%s", (_prompt) ? _prompt : DEFAULT_PROMPT, itoa ((unsigned int)value));
+        printf ("%s", mbitoa ((unsigned int)value));
     }
     return value;
 }