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:
@@ -541,7 +541,8 @@ float nsString::ToFloat(PRInt32* aErrorCode) const {
|
||||
if (mLength > 0 && mLength < sizeof(buf)) {
|
||||
char *conv_stopped;
|
||||
const char *str = ToCString(buf, sizeof(buf));
|
||||
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 == '\0') {
|
||||
*aErrorCode = (PRInt32) NS_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user