Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/corlib/System')
-rw-r--r--mcs/class/corlib/System/ChangeLog5
-rw-r--r--mcs/class/corlib/System/FloatingPointFormatter.cs14
2 files changed, 18 insertions, 1 deletions
diff --git a/mcs/class/corlib/System/ChangeLog b/mcs/class/corlib/System/ChangeLog
index ebc1a1eb8a9..a9da4bd7be4 100644
--- a/mcs/class/corlib/System/ChangeLog
+++ b/mcs/class/corlib/System/ChangeLog
@@ -1,5 +1,10 @@
2004-06-14 Atsushi Enomoto <atsushi@ximian.com>
+ * FloatingPointFormatter.cs : Recognize '%' and '\u2030' and replace
+ them with matching NumberFormatInfo properties.
+
+2004-06-14 Atsushi Enomoto <atsushi@ximian.com>
+
* Double.cs : Use IFormatProvider.GetFormat() instead of literal '-'.
* FloatingPointFormatter.cs :
Use NumberFormatInfo.NegativeSign. This change saves many XSLT test
diff --git a/mcs/class/corlib/System/FloatingPointFormatter.cs b/mcs/class/corlib/System/FloatingPointFormatter.cs
index f9d2011bc82..6afcc881fbe 100644
--- a/mcs/class/corlib/System/FloatingPointFormatter.cs
+++ b/mcs/class/corlib/System/FloatingPointFormatter.cs
@@ -877,6 +877,10 @@ namespace System {
else if (format[i] == '\\') {
sb.Append(format[++i]);
}
+ else if (format [i] == '%')
+ sb.Append (nfi.PercentSymbol);
+ else if (format [i] == '\u2030')
+ sb.Append (nfi.PerMilleSymbol);
else {
sb.Append(format[i]);
}
@@ -904,6 +908,10 @@ namespace System {
}
}
}
+ else if (format [i] == '%')
+ sb.Insert (0, nfi.PercentSymbol);
+ else if (format [i] == '\u2030')
+ sb.Insert (0, nfi.PerMilleSymbol);
else if (format[i] != ',') {
sb.Insert(0, format[i]);
}
@@ -931,7 +939,11 @@ namespace System {
mantissa /= 10;
}
for (int i = f.FirstFormatPos - 1; i >= 0; i--) {
- if (format [i] != '.')
+ if (format [i] == '%')
+ sb.Insert (0, nfi.PercentSymbol);
+ else if (format [i] == '\u2030')
+ sb.Insert (0, nfi.PerMilleSymbol);
+ else if (format [i] != '.')
sb.Insert(0, format[i]);
}
return sb.ToString();