From cfb3a9bff776959a0e5b6f62d13b9b04b9014ca1 Mon Sep 17 00:00:00 2001 From: glihm Date: Sat, 25 Jul 2020 16:22:55 -0500 Subject: [PATCH 1/2] Fix typo in CS and VB code --- .../VS_Snippets_CLR_System/system.Decimal.Parse/CS/parse.cs | 4 ++-- .../VS_Snippets_CLR_System/system.Decimal.Parse/VB/parse.vb | 4 ++-- 2 files changed, 4 insertions(+), 4 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 f9f65efa3f3..2d30534c419 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 @@ -118,7 +118,7 @@ private static void CallParseWithStylesAndProvider() CultureInfo provider; // Parse string using " " as the thousands separator - // and "." as the decimal separator. + // and "," as the decimal separator. value = "892 694,12"; style = NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands; provider = new CultureInfo("fr-FR"); @@ -141,7 +141,7 @@ private static void CallParseWithStylesAndProvider() // Unable to parse '892 694,12'. // Parse string using "$" as the currency symbol for en-GB and - // en-us cultures. + // en-US cultures. value = "$6,032.51"; style = NumberStyles.Number | NumberStyles.AllowCurrencySymbol; provider = new CultureInfo("en-GB"); 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 8c1fcb2d38a..b49fba2f202 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 @@ -107,7 +107,7 @@ Module modMain Dim provider As CultureInfo ' Parse string using " " as the thousands separator - ' and "." as the decimal separator. + ' and "," as the decimal separator. value = "892 694,12" style = NumberStyles.AllowDecimalPoint Or NumberStyles.AllowThousands provider = New CultureInfo("fr-FR") @@ -127,7 +127,7 @@ Module modMain ' Unable to parse '892 694,12'. ' Parse string using "$" as the currency symbol for en-GB and - ' en-us cultures. + ' en-US cultures. value = "$6,032.51" style = NumberStyles.Number Or NumberStyles.AllowCurrencySymbol provider = New CultureInfo("en-GB") From 462b66d164bba59a4aebc2cbb9a69cbfa5e7a03a Mon Sep 17 00:00:00 2001 From: glihm Date: Sat, 25 Jul 2020 16:31:46 -0500 Subject: [PATCH 2/2] Precise the culture using the defined separators --- .../VS_Snippets_CLR_System/system.Decimal.Parse/CS/parse.cs | 2 +- .../VS_Snippets_CLR_System/system.Decimal.Parse/VB/parse.vb | 2 +- 2 files changed, 2 insertions(+), 2 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 2d30534c419..ac9234f5d11 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 @@ -118,7 +118,7 @@ private static void CallParseWithStylesAndProvider() CultureInfo provider; // Parse string using " " as the thousands separator - // and "," as the decimal separator. + // and "," as the decimal separator for fr-FR culture. value = "892 694,12"; style = NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands; provider = new CultureInfo("fr-FR"); 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 b49fba2f202..d3a8c98ce6a 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 @@ -107,7 +107,7 @@ Module modMain Dim provider As CultureInfo ' Parse string using " " as the thousands separator - ' and "," as the decimal separator. + ' and "," as the decimal separator for fr-FR culture. value = "892 694,12" style = NumberStyles.AllowDecimalPoint Or NumberStyles.AllowThousands provider = New CultureInfo("fr-FR")