# Patch created by brubbel
# Date: Mi Mär 16 17:38:44 CET 2005
# Repository: pnetlib
# Comments:
# 
# 
# fixed doube.Parse to use the current thread culture and fixed parsing.
#### End of Preamble ####

#### Patch data follows ####
Index: runtime/System/Globalization/NumberFormatInfo.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Globalization/NumberFormatInfo.cs,v
retrieving revision 1.9
diff -c -r1.9 NumberFormatInfo.cs
*** runtime/System/Globalization/NumberFormatInfo.cs	16 Jul 2004 06:21:26 -0000	1.9
--- runtime/System/Globalization/NumberFormatInfo.cs	16 Mar 2005 16:38:52 -0000
***************
*** 75,81 ****
  			{
  				get
  				{
! 					return CultureInfo.CurrentCulture.NumberFormat;
  				}
  			}
  	public int CurrencyDecimalDigits
--- 75,82 ----
  			{
  				get
  				{
! 					// return CultureInfo.CurrentCulture.NumberFormat;
! 					return System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat;
  				}
  			}
  	public int CurrencyDecimalDigits
Index: runtime/System/Private/NumberParser.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Private/NumberParser.cs,v
retrieving revision 1.18
diff -c -r1.18 NumberParser.cs
*** runtime/System/Private/NumberParser.cs	28 Dec 2004 07:16:52 -0000	1.18
--- runtime/System/Private/NumberParser.cs	16 Mar 2005 16:38:58 -0000
***************
*** 344,352 ****
  		String posSign = nfi.PositiveSign;
  		String negSign = nfi.NegativeSign;
  		String currency = nfi.CurrencySymbol;
! 		String thousandsSep1 = nfi.CurrencyGroupSeparator;
! 		String thousandsSep2 = nfi.NumberGroupSeparator;
! 
  		// Skip leading white space.
  		posn = 0;
  		len = s.Length;
--- 344,354 ----
  		String posSign = nfi.PositiveSign;
  		String negSign = nfi.NegativeSign;
  		String currency = nfi.CurrencySymbol;
! 		
! 		String thousandsSep;
! 		if( (style & NumberStyles.Float) != 0 ) thousandsSep = nfi.NumberGroupSeparator;
! 		else                                    thousandsSep = nfi.CurrencyGroupSeparator;
! 		
  		// Skip leading white space.
  		posn = 0;
  		len = s.Length;
***************
*** 396,403 ****
  				++posn;
  			}
  			else if((style & NumberStyles.AllowThousands) != 0 &&
! 					(ch == thousandsSep1[0] ||
! 					 ch == thousandsSep2[0]))
  			{
  				++posn;
  			}
--- 398,404 ----
  				++posn;
  			}
  			else if((style & NumberStyles.AllowThousands) != 0 &&
! 					 ch == thousandsSep[0] )
  			{
  				++posn;
  			}
***************
*** 447,454 ****
  					digit = (uint)(ch - 'a' + 10);
  				}
  				else if((style & NumberStyles.AllowThousands) != 0 &&
! 						(ch == thousandsSep1[0] ||
! 						 ch == thousandsSep2[0]))
  				{
  					// Ignore thousands separators in the string.
  					++posn;
--- 448,454 ----
  					digit = (uint)(ch - 'a' + 10);
  				}
  				else if((style & NumberStyles.AllowThousands) != 0 &&
! 						ch == thousandsSep[0] )
  				{
  					// Ignore thousands separators in the string.
  					++posn;
***************
*** 504,511 ****
  					digit = (uint)(ch - '0');
  				}
  				else if((style & NumberStyles.AllowThousands) != 0 &&
! 						(ch == thousandsSep1[0] ||
! 						 ch == thousandsSep2[0]))
  				{
  					// Ignore thousands separators in the string.
  					++posn;
--- 504,510 ----
  					digit = (uint)(ch - '0');
  				}
  				else if((style & NumberStyles.AllowThousands) != 0 &&
! 						ch == thousandsSep[0])
  				{
  					// Ignore thousands separators in the string.
  					++posn;
***************
*** 1210,1223 ****
  				// check for groupseparator
  				if((style & NumberStyles.AllowThousands) != 0)
  				{
! 					if(!CheckString(ref sb, nfi.NumberGroupSeparator,
! 									ref start, end))
! 					{
  						if(!CheckString(ref sb, nfi.CurrencyGroupSeparator,
! 										ref start, end))
  						{
  							break;
  						}
  					}
  				}
  				else
--- 1209,1231 ----
  				// check for groupseparator
  				if((style & NumberStyles.AllowThousands) != 0)
  				{
! 					if( (style & NumberStyles.Float) != 0 ) {
! 						
! 						if(!CheckString(ref sb, nfi.NumberGroupSeparator,
! 								ref start, end))
! 						{
! 							break;
! 						}
! 						
! 					}
! 					else {
! 					
  						if(!CheckString(ref sb, nfi.CurrencyGroupSeparator,
! 								ref start, end))
  						{
  							break;
  						}
+ 					
  					}
  				}
  				else
#### End of Patch data ####
