From: Ken Youens-Clark Date: Wed, 5 Nov 2003 22:26:24 +0000 (+0000) Subject: Getting float sizes to work properly. X-Git-Tag: v0.04~29 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7461b4efb86842bd3ff0cfed402ca7b0ae3167ca;p=dbsrgits%2FSQL-Translator.git Getting float sizes to work properly. --- diff --git a/lib/SQL/Translator/Parser/Excel.pm b/lib/SQL/Translator/Parser/Excel.pm index 2f367e3..51eeb15 100644 --- a/lib/SQL/Translator/Parser/Excel.pm +++ b/lib/SQL/Translator/Parser/Excel.pm @@ -1,7 +1,7 @@ package SQL::Translator::Parser::Excel; # ------------------------------------------------------------------- -# $Id: Excel.pm,v 1.10 2003-10-10 15:58:11 kycl4rk Exp $ +# $Id: Excel.pm,v 1.11 2003-11-05 22:26:24 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2003 Ken Y. Clark , # darren chamberlain , @@ -54,7 +54,7 @@ and field sizes. True by default. use strict; use vars qw($DEBUG $VERSION @EXPORT_OK); $DEBUG = 0 unless defined $DEBUG; -$VERSION = sprintf "%d.%02d", q$Revision: 1.10 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.11 $ =~ /(\d+)\.(\d+)/; use Spreadsheet::ParseExcel; use Exporter; @@ -153,8 +153,11 @@ sub parse { $data =~ /^-?\.\d+$/ ) { $type = 'float'; - my ( $w, $d ) = map { s/,//g; $_ } split( /\./, $data ); - $size = [ length $w + length $d, length $d ]; + my ( $w, $d ) = + map { s/,//g; length $_ || 1 } + split( /\./, $data ) + ; + $size = [ $w + $d, $d ]; } else { $type = 'char';