[ create a new paste ] login | about

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

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

function percentOf($number, $percent){
    return $number * ($percent / 100);
}


$percent = '3.5'; //this is the percentage
$order = 400;
//then:
echo percentOf($order, $percent);


Output:
1
14


Create a new paste based on this one


Comments: