From 380d34c951f3200028937d2f36ad573dea0940cc Mon Sep 17 00:00:00 2001 From: glihm Date: Wed, 22 Jul 2020 12:39:08 -0500 Subject: [PATCH] Fix Decimal.Parse typos (#4419) --- .../system.Decimal.Parse/CS/parse.cs | 10 +++++----- .../system.Decimal.Parse/VB/parse.vb | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Parse/CS/parse.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Parse/CS/parse.cs index 0d9475b1b6a..f9f65efa3f3 100644 --- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Parse/CS/parse.cs +++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Parse/CS/parse.cs @@ -22,14 +22,14 @@ private static void CallParse() number = Decimal.Parse(value); Console.WriteLine("'{0}' converted to {1}.", value, number); // Displays: - // 16,523,421' converted to 16523421. + // '16,523,421' converted to 16523421. // Parse a floating point value with thousands separators value = "25,162.1378"; number = Decimal.Parse(value); Console.WriteLine("'{0}' converted to {1}.", value, number); // Displays: - // 25,162.1378' converted to 25162.1378. + // '25,162.1378' converted to 25162.1378. // Parse a floating point number with US currency symbol. value = "$16,321,421.75"; @@ -117,8 +117,8 @@ private static void CallParseWithStylesAndProvider() NumberStyles style; CultureInfo provider; - // Parse string using "." as the thousands separator - // and " " as the decimal separator. + // Parse string using " " as the thousands separator + // and "." as the decimal separator. value = "892 694,12"; style = NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands; provider = new CultureInfo("fr-FR"); @@ -126,7 +126,7 @@ private static void CallParseWithStylesAndProvider() number = Decimal.Parse(value, style, provider); Console.WriteLine("'{0}' converted to {1}.", value, number); // Displays: - // 892 694,12' converted to 892694.12. + // '892 694,12' converted to 892694.12. try { diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Decimal.Parse/VB/parse.vb b/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Decimal.Parse/VB/parse.vb index 925f0b2320a..8c1fcb2d38a 100644 --- a/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Decimal.Parse/VB/parse.vb +++ b/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Decimal.Parse/VB/parse.vb @@ -22,14 +22,14 @@ Module modMain number = Decimal.Parse(value) Console.WriteLine("'{0}' converted to {1}.", value, number) ' Displays: - ' 16,523,421' converted to 16523421. + ' '16,523,421' converted to 16523421. ' Parse a floating point value with thousands separators value = "25,162.1378" number = Decimal.Parse(value) Console.WriteLine("'{0}' converted to {1}.", value, number) ' Displays: - ' 25,162.1378' converted to 25162.1378. + ' '25,162.1378' converted to 25162.1378. ' Parse a floating point number with US currency symbol. value = "$16,321,421.75" @@ -106,8 +106,8 @@ Module modMain Dim style As NumberStyles Dim provider As CultureInfo - ' Parse string using "." as the thousands separator - ' and " " as the decimal separator. + ' Parse string using " " as the thousands separator + ' and "." as the decimal separator. value = "892 694,12" style = NumberStyles.AllowDecimalPoint Or NumberStyles.AllowThousands provider = New CultureInfo("fr-FR") @@ -115,7 +115,7 @@ Module modMain number = Decimal.Parse(value, style, provider) Console.WriteLine("'{0}' converted to {1}.", value, number) ' Displays: - ' 892 694,12' converted to 892694.12. + ' '892 694,12' converted to 892694.12. Try number = Decimal.Parse(value, style, CultureInfo.InvariantCulture)