mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-15 03:03:50 +00:00
made CPDecimalCreateWithString work with empty string
This commit is contained in:
1 parent
fd625c96d6
commit
8e3e15080b
1 file changed
+3
@@ -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
|
||||
|
||||
Reference in new issue
Block a user