Skip to content

Commit

Permalink
filter: check for numbers first
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed May 31, 2023
1 parent c0805f6 commit 1bc5a58
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/Thruk/Utils/Filter.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1825,6 +1825,7 @@ returns number as used in human performance data table
=cut
sub format_perf_number {
my($number, $unit, $always_show_unit) = @_;
return $number unless($number && $number =~ m/^[\d\.]+/mx);
if($number != 0 && $unit eq "B") {
my($reduced_number, $reduced_unit) = Thruk::Utils::reduce_number($number, $unit);
if($always_show_unit || $reduced_unit ne $unit) {
Expand Down

0 comments on commit 1bc5a58

Please sign in to comment.