rendered paste bodyfunction formatPrice($price) { $major = strtok($price, "."); $minor = strtok("."); if ($minor == false) { $ignore_minor = true; } else { $ignore_minor = false; } $output = ""; $i = strlen($major) - 3; while ($i > 0) { $output = "," . substr($major, $i, 3) . $output; $i -= 3; } $output = str_replace(str_replace(",", "", $output), "", $major) . $output; if ($ignore_minor == false) { $output = $output . "." . $minor; } if (substr($output, 1, 1) == ",") { $output = substr($output, 2, strlen($output)); } $output = '£' . $output; return $output;}