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

Submitted by:  Heiko Weiss <brubbel>
Submitted on:  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>
Project 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>
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 );


Heiko Weiss <brubbel>
Project Member


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.




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.5