$abc123 is returned, and I need to format it based on it's whole number. A one ditit whole number gets two decimal places. A two digit whole number gets one decimal place. A three digit whole number gets no dicimal places.
The code below works just fine for the one and two digit whole numbers. For some reason three stops at the top one, and won't pass through. Am I doing this right?...
if (ereg("[0-9]{1}.(.+)$", $abc123))
{ $abc123 = number_format("$abc123","2",".",","); }
else if (ereg("[0-9]{2}.(.+)$", $abc123))
{ $abc123 = number_format("$abc123","1",".",","); }
else
{ $abc123 = number_format("$abc123","0",".",","); }