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

Unified Diff: base/i18n/number_formatting.h

Issue 1989563002: i18n of Zoom % to use locally correct numeric glyphs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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 | « no previous file | base/i18n/number_formatting.cc » ('j') | base/i18n/number_formatting.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/number_formatting.h
diff --git a/base/i18n/number_formatting.h b/base/i18n/number_formatting.h
index bdb862f21a67754481cebec79b87a044dbb21be5..6a1b44383ac6f06483a6a7689305b7a5de1caa1b 100644
--- a/base/i18n/number_formatting.h
+++ b/base/i18n/number_formatting.h
@@ -22,6 +22,17 @@ BASE_I18N_EXPORT string16 FormatNumber(int64_t number);
// => "1,234,567.8" in English, "1.234.567,8" in German
BASE_I18N_EXPORT string16 FormatDouble(double number, int fractional_digits);
+// Return a percent formatted with space and symbol in the user's locale.
+// Ex: FormatPercent(12)
+// => "12%" in English, "12 %" in Romanian
+BASE_I18N_EXPORT string16 FormatPercent(int number);
+
+// Same as above, except that it takes a fractional decimal value.
+// Ex: FormatPercent(.1234, 2)
+// => "12.34%" in English, "12,34 %" in Romanian
+BASE_I18N_EXPORT string16 FormatPercentFromDouble(double number,
+ int fractional_digits);
+
namespace testing {
// Causes cached formatters to be discarded and recreated. Only useful for
« no previous file with comments | « no previous file | base/i18n/number_formatting.cc » ('j') | base/i18n/number_formatting.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698