Commit 957a1b3b authored by mjs's avatar mjs

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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3051 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3f425be4
2002-12-14 Maciej Stachowiak <mjs@apple.com>
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.
=== Alexander-37u1 ===
=== Alexander-36 ===
......
2002-12-14 Maciej Stachowiak <mjs@apple.com>
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.
=== Alexander-37u1 ===
=== Alexander-36 ===
......
......@@ -346,8 +346,11 @@ UString UString::from(double d)
}
if (decimalPoint <= 0) {
buf[i++] = 0;
buf[i++] = '0';
buf[i++] = '.';
for (int j = decimalPoint; j < 0; j++) {
buf[i++] = '0';
}
strcpy(buf + i, result);
} else if (decimalPoint >= length) {
strcpy(buf + i, result);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment