$totalAmountForScope3 = $user->getInt("cb_scope3depositamount", 0)
+ $user->getInt("cb_scope3additionaldepositamount", 0)
+ $user->getInt("cb_scope3finalpaymentamount", 0);
// Format the total amount with two decimal places
$formattedTotalAmountForScope3 = number_format($totalAmountForScope3, 2, '.', ',');
return $formattedTotalAmountForScope3;
Please Log in to join the conversation.
$depositAmount = (float) $user->getInt("cb_scope3depositamount", 0);
$additionalDepositAmount = (float) $user->getInt("cb_scope3additionaldepositamount", 0);
$finalPaymentAmount = (float) $user->getInt("cb_scope3finalpaymentamount", 0);
$totalAmountForScope3 = $depositAmount + $additionalDepositAmount + $finalPaymentAmount;
// Format the total amount with exactly two decimal places
$formattedTotalAmountForScope3 = number_format($totalAmountForScope3, 2, '.', '');
// Multiply the formatted total amount by 100
$resultAfterMultiplication = $formattedTotalAmountForScope3 * 100;
return $resultAfterMultiplication;
Please Log in to join the conversation.
// Assuming $user is an object that has a method getInt()
// 1. Ensure the value is treated as a float
$cbScope3DepositAmount = (float) $user->getInt("cb_scope3depositamount", 0);
// 2. Debugging: Print values for inspection
echo "Original Value: $cbScope3DepositAmount<br>";
// 3. Ensure that locale settings do not interfere with decimal places
setlocale(LC_NUMERIC, 'en_US.UTF-8');
// Multiply the value by 100 before formatting
$valueBeforeFormatting = $cbScope3DepositAmount * 100;
echo "Value Before Formatting: $valueBeforeFormatting<br>";
// Format the value with exactly two decimal places
$formattedValue = number_format($valueBeforeFormatting, 2, '.', '');
echo "Formatted Value: $formattedValue<br>";
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.