Go back to PR_strtod since strtod does different things in different locales. b=183211 sr=bzbarsky r=caillon

git-svn-id: svn://10.0.0.236/trunk@134774 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%fas.harvard.edu
2002-12-04 04:43:30 +00:00
parent 5caa782b76
commit 2c9b578539
4 changed files with 8 additions and 4 deletions

View File

@@ -468,7 +468,8 @@ float nsCString::ToFloat(PRInt32* aErrorCode) const {
if (mLength > 0) {
char *conv_stopped;
const char *str = get();
res = (float)strtod(str, &conv_stopped);
// Use PR_strtod, not strtod, since we don't want locale involved.
res = (float)PR_strtod(str, &conv_stopped);
if (conv_stopped == str+mLength) {
*aErrorCode = (PRInt32) NS_OK;
}