[ create a new paste ] login | about

Link: http://codepad.org/73zTMnUk    [ raw code | output | fork ]

PHP, pasted on Sep 6:
1
2
3
4
5
6
7
8
9
10
<?php

$num_amount = 111.0516;
$num_total = 111.9052;

function percent($num_amount, $num_total) {
    echo number_format((1 - $num_amount / $num_total) * 100, 2);
}

percent($num_amount, $num_total);


Output:
1
2

0.76


Create a new paste based on this one


Comments: