From kde-commits Sat Feb 24 00:34:45 2007 From: Harri Porten Date: Sat, 24 Feb 2007 00:34:45 +0000 To: kde-commits Subject: branches/KDE/3.5/kdelibs/kjs Message-Id: <1172277285.289728.1407.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=117227729926748 SVN commit 636737 by porten: toExponential() fix for negative numbers M +3 -0 ChangeLog M +1 -1 number_object.cpp --- branches/KDE/3.5/kdelibs/kjs/ChangeLog #636736:636737 @@ -1,5 +1,8 @@ 2007-02-23 Harri Porten + * number_object.cpp: applied patch by Justin that fixes + toExponential() calls on negative numbers. Bug #141979. + * function.cpp: implemented caller property as requested by bug report #132039 from Edward Rudd. --- branches/KDE/3.5/kdelibs/kjs/number_object.cpp #636736:636737 @@ -273,7 +273,7 @@ int decimalAdjust = 0; if (!fractionDigits.isA(UndefinedType)) { - double logx = floor(log10(x)); + double logx = floor(log10(fabs(x))); x /= pow(10.0,logx); double fx = floor(x*pow(10.0,f))/pow(10.0,f); double cx = ceil(x*pow(10.0,f))/pow(10.0,f);