Skip to content

Commit

Permalink
round fix
Browse files Browse the repository at this point in the history
  • Loading branch information
payuru committed Sep 8, 2023
1 parent de18b02 commit 6b4c939
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Payout.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ public function jsonSerialize()

$requestData = Std::removeNullValues($requestData);

/**
* В некоторых версиях PHP необходима тонкая настройка округления при сериализации
* https://stackoverflow.com/questions/42981409/php7-1-json-encode-float-issue
*/
ini_set('serialize_precision', '14');
ini_set('precision', '14');

return json_encode($requestData, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_LINE_TERMINATORS);
}
}

0 comments on commit 6b4c939

Please sign in to comment.