I need to insert a decimal into a the proper character into a string (or integer, if we're being data type specific)
For some reason, this doesn't work (why?)...
$number = "25";
if (!ereg(".", $number)) {
$price_ .= ".00";
}
if (ereg(".", $number)) {
if (!ereg(".00", $number)) {
$number .= "0";
}
}
echo $number;
And, yes, the variable $number has to be a string, for reasons too lengthy to explain (or maybe I'm just too tired right now)