diff options
Diffstat (limited to 'src/AppBundle/Utils')
-rw-r--r-- | src/AppBundle/Utils/Aqi.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/AppBundle/Utils/Aqi.php b/src/AppBundle/Utils/Aqi.php index 6451c77..1b324a8 100644 --- a/src/AppBundle/Utils/Aqi.php +++ b/src/AppBundle/Utils/Aqi.php @@ -19,12 +19,12 @@ class Aqi { $arr = $table ->{$gasName} ->{'breakpoints'}; foreach ($arr as $index => $value) { - if ($value < $concentration && $table->{$gasName}->{'breakpoints'}[$index + 1] > $concentration) { + if ($value <= $concentration && $table->{$gasName}->{'breakpoints'}[$index + 1] >= $concentration) { $bpLow = $value; $bpLowIndex = $index; } - if ($value > $concentration && $table->{$gasName}->{'breakpoints'}[$index - 1] < $concentration) { + if ($value >= $concentration && $table->{$gasName}->{'breakpoints'}[$index - 1] <= $concentration) { $bpHi = $value; $bpHiIndex = $index; } |