octave-maintainers
[Top][All Lists]
Advanced

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

Re: FIXME in str2double.cc


From: John W. Eaton
Subject: Re: FIXME in str2double.cc
Date: Thu, 27 Dec 2012 13:53:33 -0500

On 27-Dec-2012, Rik wrote:

| str2double is supposed to accept the comma as a thousands separator. 
| Octave is being lazy and removes all the commas from the string before
| processing.  This works fine for legitimate input such as str2double
| ("1,234.56") but it masks errors when you try str2double ("1,2,3,4") and
| get 1234 as a result.  I believe it has been verified that Matlab is
| actually checking for proper use of the comma and will return a NaN in the
| second case.

Could we do a regexp replacement instead of simply stripping the
commas?

jwe


reply via email to

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