Skip to content

Commit

Permalink
Fix Scientific Notation convertion
Browse files Browse the repository at this point in the history
  • Loading branch information
startailcoon committed Jun 26, 2024
1 parent 80a0ea6 commit c34f081
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Coin.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public function __construct(int|float $v = 0) {

public function add(int|float $v) {

// Convert scientific notation to string
if(stristr($v, "E-")) {
$v = sprintf('%f', $v);
}

if(is_float($v)) {
$precision = strlen(substr(strrchr($v, "."), 1));
$v = intval(str_replace(".", "", $v));
Expand Down

0 comments on commit c34f081

Please sign in to comment.