0) { $script = '.' . str_repeat( '0', $v ); $format = str_replace( $script, '', $format ); } return $format . $forma; } #Usage $number = '10000'; echo format($number); / return 10k ?>