Skip to content

Commit 202a2f1

Browse files
committed
Fix calculation bug
1 parent d123845 commit 202a2f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CodeCalculator/CodeCalculatorFloat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function decode(string $strippedCode): CodeArea
8585
$latPlaceVal = floor($latPlaceVal / OpenLocationCode::ENCODING_BASE);
8686
$lngPlaceVal = floor($lngPlaceVal / OpenLocationCode::ENCODING_BASE);
8787
$latVal += strpos(OpenLocationCode::CODE_ALPHABET, $strippedCode[$i]) * $latPlaceVal;
88-
$lngVal = strpos(OpenLocationCode::CODE_ALPHABET, $strippedCode[$i + 1]) * $lngPlaceVal;
88+
$lngVal += strpos(OpenLocationCode::CODE_ALPHABET, $strippedCode[$i + 1]) * $lngPlaceVal;
8989
}
9090
unset($i);
9191
for ($i = OpenLocationCode::PAIR_CODE_LENGTH; $i < min(strlen($strippedCode), OpenLocationCode::MAX_DIGIT_COUNT); $i++) {

0 commit comments

Comments
 (0)