New function findSide return D if number is <0
This commit is contained in:
parent
3a9d1e4d17
commit
7b488dfd39
1 changed files with 16 additions and 0 deletions
|
|
@ -113,6 +113,22 @@ function nb($p_number)
|
|||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* return D if the number is smaller than 0 , C if bigger and an empty string if
|
||||
* equal to 0. Used for displaying saldo D / C (debit / credit )
|
||||
* @param float $p_number
|
||||
*/
|
||||
function findSide($p_number)
|
||||
{
|
||||
$return ='';
|
||||
if ( $p_number > 0 ) {
|
||||
$return ='D';
|
||||
}else {
|
||||
$return =($p_number== 0)?"":"C";
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* format the number with a sep. for the thousand
|
||||
* @param $p_number number
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue