Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial.php
public static function DISC($settlement, $maturity, $price, $redemption, $basis = 0)
    {
        $settlement = Functions::flattenSingleValue($settlement);
        $maturity = Functions::flattenSingleValue($maturity);
        $price = Functions::flattenSingleValue($price);
        $redemption = Functions::flattenSingleValue($redemption);
        $basis = Functions::flattenSingleValue($basis);

        //    Validate
        if ((is_numeric($price)) && (is_numeric($redemption)) && (is_numeric($basis))) {
            $price = (float) $price;
            $redemption = (float) $redemption;
            $basis = (int) $basis;
            if (($price <= 0) || ($redemption <= 0)) {
                return Functions::NAN();
            }
            $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity, $basis);
            if (!is_numeric($daysBetweenSettlementAndMaturity)) {
                //    return date error
                return $daysBetweenSettlementAndMaturity;
            }

            return (1 - $price / $redemption) / $daysBetweenSettlementAndMaturity;
        }

        return Functions::VALUE();
    }
public static function DISC($settlement, $maturity, $price, $redemption, $basis = 0)
    {
        $settlement = Functions::flattenSingleValue($settlement);
        $maturity = Functions::flattenSingleValue($maturity);
        $price = Functions::flattenSingleValue($price);
        $redemption = Functions::flattenSingleValue($redemption);
        $basis = Functions::flattenSingleValue($basis);

        //    Validate
        if ((is_numeric($price)) && (is_numeric($redemption)) && (is_numeric($basis))) {
            $price = (float) $price;
            $redemption = (float) $redemption;
            $basis = (int) $basis;
            if (($price <= 0) || ($redemption <= 0)) {
                return Functions::NAN();
            }
            $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity, $basis);
            if (!is_numeric($daysBetweenSettlementAndMaturity)) {
                //    return date error
                return $daysBetweenSettlementAndMaturity;
            }

            return (1 - $price / $redemption) / $daysBetweenSettlementAndMaturity;
        }

        return Functions::VALUE();
    }
public static function DISC ( $ settlement , $ maturity , $ price , $ redemption , $ basis = 0 ) { $ settlement = Functions :: flattenSingleValue ( $ settlement ) ; $ maturity = Functions :: flattenSingleValue ( $ maturity ) ; $ price = Functions :: flattenSingleValue ( $ price ) ; $ redemption = Functions :: flattenSingleValue ( $ redemption ) ; $ basis = Functions :: flattenSingleValue ( $ basis ) ; //    Validate if ( ( is_numeric ( $ price ) ) && ( is_numeric ( $ redemption ) ) && ( is_numeric ( $ basis ) ) ) { $ price = ( float ) $ price ; $ redemption = ( float ) $ redemption ; $ basis = ( int ) $ basis ; if ( ( $ price <= 0 ) || ( $ redemption <= 0 ) ) { return Functions :: NAN ( ) ; } $ daysBetweenSettlementAndMaturity = DateTime :: YEARFRAC ( $ settlement , $ maturity , $ basis ) ; if ( ! is_numeric ( $ daysBetweenSettlementAndMaturity ) ) { //    return date error return $ daysBetweenSettlementAndMaturity ; } return ( 1 - $ price / $ redemption ) / $ daysBetweenSettlementAndMaturity ; } return Functions :: VALUE ( ) ; }
DISC.

Returns the discount rate for a security.

Excel Function:
DISC(settlement,maturity,price,redemption[,basis])

@category Financial Functions

@param mixed $settlement The security's settlement date.
The security settlement date is the date after the issue
date when the security is traded to the buyer.
@param mixed $maturity The security's maturity date.
The maturity date is the date when the security expires.
@param int $price The security's price per $100 face value
@param int $redemption The security's redemption value per $100 face value
@param int $basis The type of day count to use.
0 or omitted    US (NASD) 30/360
1                Actual/actual
2                Actual/360
3                Actual/365
4                European 30/360

@return float
DISC .