@ 2013-08-23T07:59:17Z <?php
//$amount = number_format(9.22337203685E+18,0,'','');
$amount = 9223372036850000000;
$number_sep = array();
$multi = 1;
$exit = false;
$i = 1000;
for($j=3;$j < 15 ;$j=$j+2) {
switch($j) {
case 3: $temp = fmod($amount, $i);
console.log($temp);
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[] = '000';
} else {
$number_sep[] = str_pad(round($temp,2),3,'0',STR_PAD_LEFT);
}
$exit = true;
}
break;
case $j > 3 : $temp = $amount % $i;
if($i < $amount) {
if(!$temp) {
$number_sep[] = '00';
} else {
$amount = $amount - $temp;
echo $temp;
$number_sep[] = $temp/($i/100);
}
} else {
if(!$temp) {
$number_sep[] = '00';
} else {
$number_sep[] = $temp/($i/100);
}
$exit = true;
};
break;
}
print_r($number_sep);
if($exit) {
break;
}
$i = 10 * 10 * $i;
}
echo implode(',',array_reverse($number_sep));
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.19 , 8.3.0 - 8.3.7 Fatal error: Uncaught Error: Undefined constant "console" in /in/oHGHq:12
Stack trace:
#0 {main}
thrown in /in/oHGHq on line 12
Process exited with code 255 . Output for 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 Warning: Use of undefined constant console - assumed 'console' (this will throw an Error in a future version of PHP) in /in/oHGHq on line 12
Array
(
[0] => 872
)
98848Array
(
[0] => 872
[1] => 98.848
)
9899520Array
(
[0] => 872
[1] => 98.848
[2] => 98.9952
)
839999488Array
(
[0] => 872
[1] => 98.848
[2] => 98.9952
[3] => 83.9999488
)
36000000000Array
(
[0] => 872
[1] => 98.848
[2] => 98.9952
[3] => 83.9999488
[4] => 36
)
2000000000000Array
(
[0] => 872
[1] => 98.848
[2] => 98.9952
[3] => 83.9999488
[4] => 36
[5] => 20
)
20,36,83.9999488,98.9952,98.848,872 Output for 4.3.0 - 4.3.11 , 4.4.0 - 4.4.9 , 5.0.0 - 5.0.5 , 5.1.0 - 5.1.6 , 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 , 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.40 , 7.0.0 - 7.0.33 , 7.1.0 - 7.1.33 Notice: Use of undefined constant console - assumed 'console' in /in/oHGHq on line 12
Array
(
[0] => 872
)
98848Array
(
[0] => 872
[1] => 98.848
)
9899520Array
(
[0] => 872
[1] => 98.848
[2] => 98.9952
)
839999488Array
(
[0] => 872
[1] => 98.848
[2] => 98.9952
[3] => 83.9999488
)
36000000000Array
(
[0] => 872
[1] => 98.848
[2] => 98.9952
[3] => 83.9999488
[4] => 36
)
2000000000000Array
(
[0] => 872
[1] => 98.848
[2] => 98.9952
[3] => 83.9999488
[4] => 36
[5] => 20
)
20,36,83.9999488,98.9952,98.848,872 preferences:dark mode live preview
292.1 ms | 405 KiB | 462 Q