3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $number = '101234.50789'; $trunc = preg_replace( '/^.*?[0]*([\d\,]+)(([\.][\d]{0,2})([\d]*))?.*?$/', '$1$3', $number ); echo $trunc;
Output for 4.3.0 - 7.2.0
101234.50