function custom_currency($val, $sep = ',', $decimal = '.') { $val = explode($decimal, $val); $op = $val[0]; $op = custom_number($op, $sep); return $op . ($val[1] ? $decimal . $val[1] : ''); }
function testCustomNumberDecimalLonger() { $this->assertEquals('12,345,678.12345678', custom_number('12345678.12345678')); }