<?php
$amount = 10000000;
$amount = number_format($amount,0,'','');
if($amount < 1) {
return 0;
}
if($intowords) {
$price = get_auction_price_words($amount);
if(!empty($price)) {
return $price;
}
}
$number_sep = array();
$multi = 1;
$exit = false;
$i = 1000;
for($j=3;$j < 15 ;$j=$j+2) {
switch($j) {
case 3: $temp = ($amount/$i);$temp = round(($temp - floor($temp)) * 1000,2);
if($i < $amount) {
if(!$temp) {
$number_sep[] = '000';
} else {
$amount = $amount - $temp;
$number_sep[] = str_pad(round($temp,2),3,'0',STR_PAD_LEFT);
}
} else {
if(!$temp) {
$number_sep[] = $i;
} else {
$number_sep[] = round($temp,2);
}
$exit = true;
}
break;
case $j > 3 : $temp = $amount % $i;
if($i < $amount) {
if(!$temp) {
$number_sep[] = '00';
} else {
$amount = $amount - $temp;
$number_sep[] = str_pad(round($temp/($i/100)),2,'0',STR_PAD_LEFT);
}
} else {
if(!$temp) {
$number_sep[] = '00';
} else {
$number_sep[] = round($temp/($i/100));
}
$exit = true;
};
break;
}
if($exit) {
break;
}
$i = 10 * 10 * $i;
}
echo $i;
preferences:
44.2 ms | 402 KiB | 5 Q