summaryrefslogtreecommitdiff
path: root/LedgerSMB.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-06 22:25:48 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-06 22:25:48 +0000
commit345edc39172a87ed0bd473269ff22cd29c279535 (patch)
tree854bb6eb7461e7b4edee36099dfa85d5da9d1d6c /LedgerSMB.pm
parent8132f9e4c6e084ba0bc7b57e6a25a93b0c27b972 (diff)
Adding type detection so that NUMERIC types from the db are handed off to Math::BigFloat
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1138 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB.pm')
-rwxr-xr-xLedgerSMB.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/LedgerSMB.pm b/LedgerSMB.pm
index 073a73ab..9f3ac71d 100755
--- a/LedgerSMB.pm
+++ b/LedgerSMB.pm
@@ -434,7 +434,14 @@ sub call_procedure {
$query =~ s/\(\)/($argstr)/;
my $sth = $self->{dbh}->prepare($query);
$sth->execute(@args);
+ my @types = @{$sth->{TYPE}};
+ my @names = @{$sth->{NAME_lc}};
while ( my $ref = $sth->fetchrow_hashref('NAME_lc') ) {
+ for (0 .. $#names){
+ if ($types[$_] eq 'NUMERIC'){
+ $ref->{$names[$_]} = Math::BigFloat->new($ref->{$names[$_]});
+ }
+ }
push @results, $ref;
}
@results;