made CPDecimalCreateWithString work with empty string

This commit is contained in:
Klaas Pieter Annema committed 2010-05-06 14:13:29 +02:00
1 parent fd625c96d6
commit 8e3e15080b
1 file changed
+3
+3
View File
@@ -101,6 +101,9 @@ CPDecimal format:
// FIXME: locale support and Cocoaify, needs to accept .1 and leading 0s
function CPDecimalMakeWithString(string, locale)
{
if (!string)
return CPDecimalMakeZero();
// Regexp solution as found in JSON spec, with working regexp (I added groupings)
// Test here: http://www.regexplanet.com/simple/index.html
// Info from: http://stackoverflow.com/questions/638565/parsing-scientific-notation-sensibly