From 98a12a83802687b5f99951a5e0cb1aaa8dcffa5d Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sun, 18 Dec 2005 17:52:28 +0000 Subject: [PATCH] fix follow bug hex->dec, bin->dec, oct->dec, now all converting should work fine. I have not found any more problem with it. svn path=/trunk/; revision=20249 --- reactos/subsys/system/calc/winecalc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reactos/subsys/system/calc/winecalc.c b/reactos/subsys/system/calc/winecalc.c index 22781b13ee6..add5cc99227 100644 --- a/reactos/subsys/system/calc/winecalc.c +++ b/reactos/subsys/system/calc/winecalc.c @@ -3016,6 +3016,8 @@ void calc_buffer_display(CALC *calc) { int lz = 0; int exp = 0; + + real = calc_atof(calc->buffer,old_base); _stprintf(s, FMT_DESC_EXP, real); // remove leading zeros in exponent @@ -3056,6 +3058,20 @@ void calc_buffer_display(CALC *calc) { // add point if missing // display + if (old_base != calc->numBase) + { + if (calc->buffer[0]==_T('\0')) + { + real = 0; + } + else + { + real = calc_atof(calc->buffer, old_base); + } + _stprintf(calc->display, _T("%.f"), real); + _stprintf(calc->buffer, _T("%.f"), real); + } + _tcscpy(s,calc->buffer); p = s;