Return-Path: Delivered-To: apmail-lucene-lucene-net-dev-archive@www.apache.org Received: (qmail 63277 invoked from network); 22 Mar 2011 12:45:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Mar 2011 12:45:47 -0000 Received: (qmail 95462 invoked by uid 500); 22 Mar 2011 12:45:46 -0000 Delivered-To: apmail-lucene-lucene-net-dev-archive@lucene.apache.org Received: (qmail 95362 invoked by uid 500); 22 Mar 2011 12:45:46 -0000 Mailing-List: contact lucene-net-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucene.apache.org Delivered-To: mailing list lucene-net-dev@lucene.apache.org Received: (qmail 95354 invoked by uid 99); 22 Mar 2011 12:45:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Mar 2011 12:45:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Mar 2011 12:45:45 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 53BF142B9F for ; Tue, 22 Mar 2011 12:45:09 +0000 (UTC) Date: Tue, 22 Mar 2011 12:45:09 +0000 (UTC) From: "Sergey Mirvoda (JIRA)" To: lucene-net-dev@lucene.apache.org Message-ID: <2017675859.3643.1300797909339.JavaMail.tomcat@hel.zones.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Subject: [Lucene.Net] [jira] [Commented] (LUCENENET-85) SupportClass.Parse and System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator [ https://issues.apache.org/jira/browse/LUCENENET-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009628#comment-13009628 ] Sergey Mirvoda commented on LUCENENET-85: ----------------------------------------- Why invariant culture? You should always use CurrentCulture or require cultureInfo as a parameter. If you use invariant culture you will fail with parsing _any_ culture specific strings for example in Russia ,(not .) is a decimal separator. and I also think that method above is wrong. > SupportClass.Parse and System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator > ---------------------------------------------------------------------------------------------------------- > > Key: LUCENENET-85 > URL: https://issues.apache.org/jira/browse/LUCENENET-85 > Project: Lucene.Net > Issue Type: Bug > Reporter: Digy > Assignee: George Aroush > Priority: Minor > Attachments: SupportClass.patch > > > Again System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator problem > public static System.Single Parse(System.String s) > { > try > { > if (s.EndsWith("f") || s.EndsWith("F")) > return System.Single.Parse(s.Substring(0, s.Length - 1).Replace(".", System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)); > else > return System.Single.Parse(s.Replace(".", System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)); > } > catch(System.FormatException fex) > { > throw fex; > } > } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira