For the project I'm working on I am trying to display the GP on page of a mule but I can't get it to correctly show the notation. :x
$holdingAmount = $Mulesrow['holdingamount'];
if($holdingAmount >= 1000){
$holdingLength = strlen($holdingAmount);
$strArg = 1;
for($i = 0; $i < $holdingLength; $i++){
$strArg = $strArg * 10;
}
if ($holdingAmount >= 1000000) {
$holdingAmount = floor(($holdingAmount / 1000000) * $strArg ) / $strArg . "M";
} else if ($holdingAmount >= 1000) {
$holdingAmount = floor(($holdingAmount / 1000) * 100) / 100 . "K";
}
}
I need it to show the correct amount depending on the annotation.
So if I for example have 21119999 it should show 21.11M instead of 21.12M.
This should be done so depending on the length.