Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4875)

Unified Diff: base/json_writer.cc

Issue 11002: Make unit_tests pass with pt_BR.UTF-8 locale. (Closed)
Patch Set: all platforms Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/json_reader.cc ('k') | base/string_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json_writer.cc
diff --git a/base/json_writer.cc b/base/json_writer.cc
index 10dd39fd61d5bf6d18067d2bb832f8e24ae3906c..4782eb55bda957bbd175403d5fbb427e98b57f42 100644
--- a/base/json_writer.cc
+++ b/base/json_writer.cc
@@ -58,7 +58,7 @@ void JSONWriter::BuildJSONString(const Value* const node, int depth) {
double value;
bool result = node->GetAsReal(&value);
DCHECK(result);
- std::string real = StringPrintf("%g", value);
+ std::string real = base::DoubleToString(value, base::LOCALE_INDEPENDENT);
// Ensure that the number has a .0 if there's no decimal or 'e'. This
// makes sure that when we read the JSON back, it's interpreted as a
// real rather than an int.
« no previous file with comments | « base/json_reader.cc ('k') | base/string_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698