dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] [bugs #11332] NumberParser ignores setting the culture


From: Heiko Weiss
Subject: [Pnet-developers] [bugs #11332] NumberParser ignores setting the culture info parsing floats
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)

This mail is an automated notification from the bugs tracker
 of the project: DotGNU Portable.NET.




/**************************************************************************/
[bugs #11332] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=11332>
Project: DotGNU Portable.NET
Submitted by: Heiko Weiss
On: Fre 17.12.2004 at 06:06

Category:  None
Severity:  5 - Average
Item Group:  None
Resolution:  None
Privacy:  Public
Assigned to:  None
Status:  Open


Summary:  NumberParser ignores setting the culture info parsing floats

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();
                }

        }
}












For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=11332>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]