<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem with numbers in English/French switch in my Custom Addin in EG4.1 in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-numbers-in-English-French-switch-in-my-Custom-Addin/m-p/1359#M402</link>
    <description>You will need to add a second item to the Convert.ToDouble() statement.  After your Me.TextBox1.Text add a second argument of "System.Globalization.CultureInfo.InvariantCulture".  This will force the Convert.ToDouble() to use the default/US-english locale for the conversion no matter what Tools/Options/General/Locale settings.</description>
    <pubDate>Wed, 30 Aug 2006 18:10:21 GMT</pubDate>
    <dc:creator>Bill_SAS</dc:creator>
    <dc:date>2006-08-30T18:10:21Z</dc:date>
    <item>
      <title>Problem with numbers in English/French switch in my Custom Addin in EG4.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-numbers-in-English-French-switch-in-my-Custom-Addin/m-p/1358#M401</link>
      <description>Hi Chris and everybody,&lt;BR /&gt;
&lt;BR /&gt;
I created a Custom Task for EG4.1 that must be bilingual, that is:&lt;BR /&gt;
1. must work in English if the user set Tools/Options/General/English(United States)&lt;BR /&gt;
2. must work in French if the user set Tools/Options/General/French(France)&lt;BR /&gt;
&lt;BR /&gt;
In my task I need to validate user input numbers, entered as strings in textboxes for example “4.25”.&lt;BR /&gt;
In my VB.NET code, I use the Convert.ToDouble(Me.TextBox1.Text) statement to convert the user’s entry in order to check the value (in the example, Me.TextBox1.Text = “4.25”).&lt;BR /&gt;
&lt;BR /&gt;
As far as the EG4.1 language settings is Tools/Options/General/English(United States), the string “4.25” is converted to the double 4.25, which is great.&lt;BR /&gt;
&lt;BR /&gt;
However, when the language settings is Tools/Options/General/French(France), “4.25” CAN NOT be converted to a double, as an exception is raised: “Input string was not in a correct format”. At the same time, “4,25” IS converted to a double, written 4,25 (which I don’t like because I write numerics is my SAS code using a period. And even if I replace the comma by the period when writing to my SAS code, I will have to do the reverse when I populate the form with the task state saved in XMLState. This is laborious!).&lt;BR /&gt;
&lt;BR /&gt;
So in my CUSTOM TASKS, English(United States) seems to use the period as decimal separator, while French(France) uses the comma.&lt;BR /&gt;
&lt;BR /&gt;
BUT in NATIVE EG4.1 tasks (those supplied by SAS), the period is used as decimal separator, regardless of the languages settings (English(United States) or French(France)).&lt;BR /&gt;
&lt;BR /&gt;
So my question is: How do I force my Custom Task to have the same behaviour as the native task? (that is to recognise only the period as the decimal separator regardless of the EG4.1 languages settings).&lt;BR /&gt;
&lt;BR /&gt;
Thanks for any help!&lt;BR /&gt;
&lt;BR /&gt;
Maurice2</description>
      <pubDate>Wed, 30 Aug 2006 14:51:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-numbers-in-English-French-switch-in-my-Custom-Addin/m-p/1358#M401</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-08-30T14:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with numbers in English/French switch in my Custom Addin in EG4.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-numbers-in-English-French-switch-in-my-Custom-Addin/m-p/1359#M402</link>
      <description>You will need to add a second item to the Convert.ToDouble() statement.  After your Me.TextBox1.Text add a second argument of "System.Globalization.CultureInfo.InvariantCulture".  This will force the Convert.ToDouble() to use the default/US-english locale for the conversion no matter what Tools/Options/General/Locale settings.</description>
      <pubDate>Wed, 30 Aug 2006 18:10:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-numbers-in-English-French-switch-in-my-Custom-Addin/m-p/1359#M402</guid>
      <dc:creator>Bill_SAS</dc:creator>
      <dc:date>2006-08-30T18:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with numbers in English/French switch in my Custom Addin in EG4.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-numbers-in-English-French-switch-in-my-Custom-Addin/m-p/1360#M403</link>
      <description>Maurice,&lt;BR /&gt;
&lt;BR /&gt;
You need to convert your numbers to strings using the InvariantCulture format provider.  For example:&lt;BR /&gt;
&lt;BR /&gt;
double myDouble = 4.25;&lt;BR /&gt;
string value = myDouble.ToString(System.Globalization.CultureInfo.InvariantCulture);&lt;BR /&gt;
&lt;BR /&gt;
That will prevent the French culture settings from influencing the text value.&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
      <pubDate>Wed, 30 Aug 2006 18:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-numbers-in-English-French-switch-in-my-Custom-Addin/m-p/1360#M403</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2006-08-30T18:13:09Z</dc:date>
    </item>
  </channel>
</rss>

