From: Jason Woofenden Date: Thu, 18 Oct 2007 05:43:51 +0000 (-0400) Subject: fixed format_int() to remove leading zeros even when the number is all zeros (eg... X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=a2093c37f91d34a3798c7a8f23f6c53baea8beb0 fixed format_int() to remove leading zeros even when the number is all zeros (eg 00, 000, 0000, etc.) --- diff --git a/format.php b/format.php index 1586ff0..bb34919 100644 --- a/format.php +++ b/format.php @@ -42,7 +42,7 @@ function format_options($str, $name) { function format_int($str) { $str = ereg_replace('[^0-9]', '', $str); - return ereg_replace('^0*([1-9])', '\1', $str); + return ereg_replace('^0*([0-9])', '\1', $str); } function format_decimal($str) {