Skip to content

Commit

Permalink
Update Wei.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ranabd36 authored Dec 16, 2019
1 parent fd82ebc commit dfd412c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Types/Wei.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ private function format($amount)
if (count($comps) > 2 || count($comps) < 2 ) {
throw new \Exception('Invalid scientific notation.');
}


if (preg_match('/./', $comps[0], $match)) {
$comps[0] = str_replace('.','',$comps[0]);
}

return str_pad(intval($comps[0]), $comps[1] + 1, '0', STR_PAD_RIGHT);
}

Expand Down

0 comments on commit dfd412c

Please sign in to comment.