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: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned 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>
[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>
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 click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Thu 17 Mar 2005 07:54:13 AM UTCdrobossonStatusNone=>Fixed
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1