# give/4.16.9/src/Donations/ListTable/Columns/AmountColumn.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 55 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/Donations/ListTable/Columns/AmountColumn.php
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/Donations/ListTable/Columns/AmountColumn.php
- Modified: 2025-10-01T11:37:12+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.9/code/src/Donations/ListTable/Columns/AmountColumn.php#L10-L20`.

```php
<?php

declare(strict_types=1);

namespace Give\Donations\ListTable\Columns;

use Give\Donations\Models\Donation;
use Give\Framework\ListTable\ModelColumn;

/**
 * @since 2.24.0
 *
 * @extends ModelColumn<Donation>
 */
class AmountColumn extends ModelColumn
{

    protected $sortColumn = 'COALESCE(CAST(amount AS DECIMAL) / COALESCE(CAST(exchangeRate AS DECIMAL), 1), 0)';
    
    /**
     * @since 2.24.0
     *
     * @inheritDoc
     */
    public static function getId(): string
    {
        return 'amount';
    }

    /**
     * @since 2.24.0
     *
     * @inheritDoc
     */
    public function getLabel(): string
    {
        return __('Amount', 'give');
    }

    /**
     * @since 2.24.0
     *
     * @inheritDoc
     *
     * @param Donation $model
     */
    public function getCellValue($model, $locale = ''): string
    {
        return sprintf(
            '<div class="amount"><span>%s</span></div>',
            $model->amount->formatToLocale($locale)
        );
    }
}

```
