Skip to content

Commit

Permalink
Added toFloat method
Browse files Browse the repository at this point in the history
  • Loading branch information
luza authored and Denis Girko committed Dec 13, 2020
1 parent 31ef78a commit 570f5ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/RtLopez/Decimal.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ public function __toString()
{
return $this->toString();
}


public function toFloat()
{
return floatval($this->toString());
}

public function format($prec = null, $dec_point = null , $thousands_sep = null, $trailing_zero = true)
{
if ($dec_point === null) {
Expand Down

0 comments on commit 570f5ae

Please sign in to comment.