summaryrefslogtreecommitdiff
path: root/FS/FS/UI/bytecount.pm
diff options
context:
space:
mode:
authorjeff <jeff>2007-04-26 03:09:15 +0000
committerjeff <jeff>2007-04-26 03:09:15 +0000
commitb720d1c49ddb8eb87918b1344975492a87b40c33 (patch)
treed06cec2c02ff64bb392c9f4ac54eef3f08425c37 /FS/FS/UI/bytecount.pm
parent8cc02af5f02c09118764e4b763dcc9ebec08c2e3 (diff)
improve configfile handling
Diffstat (limited to 'FS/FS/UI/bytecount.pm')
-rw-r--r--FS/FS/UI/bytecount.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/FS/FS/UI/bytecount.pm b/FS/FS/UI/bytecount.pm
index 233082b..c2352da 100644
--- a/FS/FS/UI/bytecount.pm
+++ b/FS/FS/UI/bytecount.pm
@@ -70,7 +70,8 @@ sub display_bytecount {
return $bc unless ($bc =~ /^(\d+)$/);
my $conf = new FS::Conf;
my $f = new Number::Format;
- my $precision = $conf->exists('datavolume-significantdigits')
+ my $precision = ( $conf->exists('datavolume-significantdigits') &&
+ $conf->config('datavolume-significantdigits') =~ /^\s*\d+\s*$/ )
? $conf->config('datavolume-significantdigits')
: 3;
my $unit = $conf->exists('datavolume-forcemegabytes') ? 'M' : 'A';