aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/AppBundle/Utils/Aqi.php')
-rw-r--r--src/AppBundle/Utils/Aqi.php4
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;
}