[interchange-cvs] interchange - racke modified lib/Vend/Util.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Thu Mar 30 10:51:50 EST 2006
User: racke
Date: 2006-03-30 15:51:50 GMT
Modified: lib/Vend Util.pm
Log:
fix weird error with missing frac digits in UI typically caused by missing
locale in Debian installations, reported by Michael Hess on IRC (among
others)
Revision Changes Path
2.93 +7 -4 interchange/lib/Vend/Util.pm
rev 2.93, prev_rev 2.92
Index: Util.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Util.pm,v
retrieving revision 2.92
retrieving revision 2.93
diff -u -r2.92 -r2.93
--- Util.pm 21 Feb 2006 12:18:38 -0000 2.92
+++ Util.pm 30 Mar 2006 15:51:49 -0000 2.93
@@ -1,6 +1,6 @@
# Vend::Util - Interchange utility functions
#
-# $Id: Util.pm,v 2.92 2006/02/21 12:18:38 ton Exp $
+# $Id: Util.pm,v 2.93 2006/03/30 15:51:49 racke Exp $
#
# Copyright (C) 2002-2005 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -88,7 +88,7 @@
use Vend::File;
use subs qw(logError logGlobal);
use vars qw($VERSION @EXPORT @EXPORT_OK);
-$VERSION = substr(q$Revision: 2.92 $, 10);
+$VERSION = substr(q$Revision: 2.93 $, 10);
my $Eval_routine;
my $Eval_routine_file;
@@ -512,8 +512,11 @@
$dec = $loc->{mon_decimal_point} || $loc->{decimal_point} || '.';
return picture_format($amount, $loc->{price_picture}, $sep, $dec)
if defined $loc->{price_picture};
- $fmt = "%." . $loc->{frac_digits} . "f";
-
+ if (defined $loc->{frac_digits}) {
+ $fmt = "%." . $loc->{frac_digits} . "f";
+ } else {
+ $fmt = "%.2f";
+ }
my $cs;
my $display = lc($opt->{display}) || 'symbol';
my $sep_by_space = $loc->{p_sep_by_space};
More information about the interchange-cvs
mailing list