bugDotGNU Portable.NET - Bugs: bug #11332, NumberParser ignores setting the...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #11332: NumberParser ignores setting the culture info parsing floats

Submitter:  Heiko Weiss <brubbel>
Submitted:  Fri 17 Dec 2004 06:06:40 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Thu 17 Mar 2005 07:54:13 AM UTC, comment #1: 

Fixed by patch #3833



fixed in cvs

Deryk Robosson <drobosson>
Group Member
Fri 17 Dec 2004 06:06:40 AM UTC, original submission:  


if U set the CultureInfo to use a "." to parse floats on a german system it is ignored. See sample:

using System;
using System.Globalization;
using System.Threading;

namespace main
{
/// <summary>
/// Zusammenfassung für Class1.
/// </summary>
class Class1
{
/// <summary>
/// Der Haupteinstiegspunkt für die Anwendung.
/// </summary>
[STAThread]
static void Main(string[] args)
{
      CultureInfo m_CultureInfo = (CultureInfo) Thread.CurrentThread.CurrentCulture.Clone();
     
      try {
        m_CultureInfo.NumberFormat.NumberDecimalSeparator = ".";
        m_CultureInfo.NumberFormat.NumberGroupSeparator   = "";
        Thread.CurrentThread.CurrentCulture = m_CultureInfo;
      }
      catch( Exception ) {
      }

      float f;
      f = float.Parse( "0.9" );
      Console.WriteLine( "Float ist : " + f );
      Console.Read();
}

}
}

Heiko Weiss <brubbel>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-03-17 drobosson StatusNone Fixed
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code