Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions simpledonate.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ function simpledonate_civicrm_pageRun(&$page) {
}
else {
$priceFieldVal = civicrm_api3('PriceFieldValue', 'get', array('return' => "amount, title, name, is_default","price_field_id"=> $value['id'], 'is_active' => 1));
// Format the amount.
foreach ($priceFieldVal['values'] as $k => $dontCare) {
$amount = $priceFieldVal['values'][$k]['amount'];
$priceFieldVal['values'][$k]['amount'] = CRM_Utils_Money::format($amount, NULL, NULL, TRUE);
$n = $priceFieldVal['values'][$k]['amount'];
$priceFieldVal['values'][$k]['amount'] = (floor($n) == round($n, 2)) ? number_format($n) : number_format($n, 2);
}
$priceList = $priceFieldVal['values'];
$htmlPriceList[$value['html_type']] = $priceFieldVal['values'];
}
Expand Down