3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function getCoefAtAmericanFormat($coef) { if ($coef == '' || $coef == 0) { return 0; } return $coef == 2 ? "+100" : $coef < 2 ? '-' . round(100 / ($coef - 1)) : '+' . round((($coef - 1) * 100)); } echo getCoefAtAmericanFormat(1.04);
Output for 4.3.0 - 7.2.0
-2500