Changeset 3051 in webkit for trunk/JavaScriptCore/kjs/ustring.cpp


Ignore:
Timestamp:
Dec 14, 2002, 4:37:56 PM (22 years ago)
Author:
mjs
Message:

Reviewed by Dave.

  • fix toString() conversion for numbers less than 1. Negative exponents are still wrong though (things like 1E-34).
  • kjs/ustring.cpp: (UString::from): Don't print empty string for numbers less than 1, and remember to add extra 0s after the decimal for negative decimal positions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/ustring.cpp

    r2912 r3051  
    347347 
    348348  if (decimalPoint <= 0) {
    349     buf[i++] = 0;
     349    buf[i++] = '0';
    350350    buf[i++] = '.';
     351    for (int j = decimalPoint; j < 0; j++) {
     352      buf[i++] = '0';
     353    }
    351354    strcpy(buf + i, result);
    352355  } else if (decimalPoint >= length) {
Note: See TracChangeset for help on using the changeset viewer.