diff options
Diffstat (limited to 'Source/TableDump.m')
-rw-r--r-- | Source/TableDump.m | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m index 48ff5b04..ab96baf3 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -850,10 +850,12 @@ // Until we have access to field types, test whether this cell contains a // number via use of an NSScanner and a check of the first couple of - // characters. If it is a number, add the number directly. + // characters (0[^.] is not a number). If it is a number, add the number directly. sqlNumericTester = [NSScanner scannerWithString:cellValue]; if ([sqlNumericTester scanFloat:nil] && [sqlNumericTester isAtEnd] && - ([cellValue characterAtIndex:0] != '0' || [cellValue characterAtIndex:1] == '.')) { + ([cellValue characterAtIndex:0] != '0' + || [cellValue length] == 1 + || ([cellValue length] > 1 && [cellValue characterAtIndex:1] == '.'))) { [sqlString appendString:cellValue]; // Otherwise add a quoted string with special characters escaped |