[ros-diffs] [gschneider] 41813: According to http://msdn.microsoft.com/en-us/library/tcxf1dw6(VS.71).aspx and http://www.cplusplus.com/reference/clibrary/cstdio/printf/ there are no %le and %lf printf formats. The 'l' specifier is used for integers or wide characters, 'L' for long double. Outputting a double doesn't require any additional specifier (see http://msdn.microsoft.com/en-us/library/hf4y5e3w(VS.71).aspx).

gschneider at svn.reactos.org gschneider at svn.reactos.org
Wed Jul 8 22:06:12 CEST 2009


Author: gschneider
Date: Thu Jul  9 00:06:11 2009
New Revision: 41813

URL: http://svn.reactos.org/svn/reactos?rev=41813&view=rev
Log:
According to http://msdn.microsoft.com/en-us/library/tcxf1dw6(VS.71).aspx and http://www.cplusplus.com/reference/clibrary/cstdio/printf/ there are no %le and %lf printf formats. The 'l' specifier is used for integers or wide characters, 'L' for long double. Outputting a double doesn't require any additional specifier (see http://msdn.microsoft.com/en-us/library/hf4y5e3w(VS.71).aspx).

Modified:
    trunk/reactos/base/applications/calc/utl.c

Modified: trunk/reactos/base/applications/calc/utl.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/utl.c?rev=41813&r1=41812&r2=41813&view=diff
==============================================================================
--- trunk/reactos/base/applications/calc/utl.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/calc/utl.c [iso-8859-1] Thu Jul  9 00:06:11 2009
@@ -21,9 +21,9 @@
         /* calculate the width of integer number */
         width = (rpn->f==0) ? 1 : (int)log10(fabs(rpn->f))+1;
         if (calc.sci_out == TRUE || width > MAX_LD_WIDTH || width < -MAX_LD_WIDTH)
-            ptr = buffer + _stprintf(buffer, TEXT("%#le"), rpn->f);
+            ptr = buffer + _stprintf(buffer, TEXT("%#e"), rpn->f);
         else {
-            ptr = buffer + _stprintf(buffer, TEXT("%#*.*lf"), width, ((MAX_LD_WIDTH-width-1)>=0) ? MAX_LD_WIDTH-width-1 : 0, rpn->f);
+            ptr = buffer + _stprintf(buffer, TEXT("%#*.*f"), width, ((MAX_LD_WIDTH-width-1)>=0) ? MAX_LD_WIDTH-width-1 : 0, rpn->f);
             dst = _tcschr(buffer, TEXT('.'));
             while (--ptr > dst)
                 if (*ptr != TEXT('0'))



More information about the Ros-diffs mailing list