brick / math

Arbitrary-precision arithmetic library for PHP
MIT License
1.83k stars 78 forks source link

The right way to get result value in string format is only using the __toString() ? #25

Closed XavierTecBr closed 5 years ago

BenMorel commented 5 years ago

If I understand your question correctly, yes.

This is a magic method though, to be used for casting to string:

$a = BigDecimal::of('12.34');
$string = (string) $a; // equivalent to $a->__toString();

If I did not understand your question, please reformulate it.

XavierTecBr commented 5 years ago

Yes this is it. Thanks so much.