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);