From 7995672a70ddaaa52aacc7eb19bec75aabcd5e8e Mon Sep 17 00:00:00 2001 From: Christophe Gerbier Date: Wed, 20 Dec 2017 20:54:41 +0100 Subject: [PATCH] Update Number.cs Fixes nanoframework/Home#118 --- source/System/Number.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/System/Number.cs b/source/System/Number.cs index 1f0879fc..882d93be 100644 --- a/source/System/Number.cs +++ b/source/System/Number.cs @@ -290,6 +290,10 @@ public static String Format(Object value, bool isInteger, String format, NumberF if (isInteger) { + // Special case : type is integer, value = 0 and format string = "N0" + // No processing needed, simply return "0" (native code returns empty string for this special case) + if (isInteger && result == String.Empty && format == "N0") return "0"; + return PostProcessInteger(value, result, formatCh, precision, info); } return PostProcessFloat(result, formatCh, info);