Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial.php
public static function TBILLPRICE($settlement, $maturity, $discount)
    {
        $settlement = Functions::flattenSingleValue($settlement);
        $maturity = Functions::flattenSingleValue($maturity);
        $discount = Functions::flattenSingleValue($discount);

        if (is_string($maturity = DateTime::getDateValue($maturity))) {
            return Functions::VALUE();
        }

        //    Validate
        if (is_numeric($discount)) {
            if ($discount <= 0) {
                return Functions::NAN();
            }

            if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
                ++$maturity;
                $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity) * 360;
                if (!is_numeric($daysBetweenSettlementAndMaturity)) {
                    //    return date error
                    return $daysBetweenSettlementAndMaturity;
                }
            } else {
                $daysBetweenSettlementAndMaturity = (DateTime::getDateValue($maturity) - DateTime::getDateValue($settlement));
            }

            if ($daysBetweenSettlementAndMaturity > 360) {
                return Functions::NAN();
            }

            $price = 100 * (1 - (($discount * $daysBetweenSettlementAndMaturity) / 360));
            if ($price <= 0) {
                return Functions::NAN();
            }

            return $price;
        }

        return Functions::VALUE();
    }
public static function TBILLPRICE($settlement, $maturity, $discount)
    {
        $settlement = Functions::flattenSingleValue($settlement);
        $maturity = Functions::flattenSingleValue($maturity);
        $discount = Functions::flattenSingleValue($discount);

        if (is_string($maturity = DateTime::getDateValue($maturity))) {
            return Functions::VALUE();
        }

        //    Validate
        if (is_numeric($discount)) {
            if ($discount <= 0) {
                return Functions::NAN();
            }

            if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
                ++$maturity;
                $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity) * 360;
                if (!is_numeric($daysBetweenSettlementAndMaturity)) {
                    //    return date error
                    return $daysBetweenSettlementAndMaturity;
                }
            } else {
                $daysBetweenSettlementAndMaturity = (DateTime::getDateValue($maturity) - DateTime::getDateValue($settlement));
            }

            if ($daysBetweenSettlementAndMaturity > 360) {
                return Functions::NAN();
            }

            $price = 100 * (1 - (($discount * $daysBetweenSettlementAndMaturity) / 360));
            if ($price <= 0) {
                return Functions::NAN();
            }

            return $price;
        }

        return Functions::VALUE();
    }
public static function TBILLPRICE ( $ settlement , $ maturity , $ discount ) { $ settlement = Functions :: flattenSingleValue ( $ settlement ) ; $ maturity = Functions :: flattenSingleValue ( $ maturity ) ; $ discount = Functions :: flattenSingleValue ( $ discount ) ; if ( is_string ( $ maturity = DateTime :: getDateValue ( $ maturity ) ) ) { return Functions :: VALUE ( ) ; } //    Validate if ( is_numeric ( $ discount ) ) { if ( $ discount <= 0 ) { return Functions :: NAN ( ) ; } if ( Functions :: getCompatibilityMode ( ) == Functions :: COMPATIBILITY_OPENOFFICE ) { ++ $ maturity ; $ daysBetweenSettlementAndMaturity = DateTime :: YEARFRAC ( $ settlement , $ maturity ) * 360 ; if ( ! is_numeric ( $ daysBetweenSettlementAndMaturity ) ) { //    return date error return $ daysBetweenSettlementAndMaturity ; } } else { $ daysBetweenSettlementAndMaturity = ( DateTime :: getDateValue ( $ maturity ) - DateTime :: getDateValue ( $ settlement ) ) ; } if ( $ daysBetweenSettlementAndMaturity > 360 ) { return Functions :: NAN ( ) ; } $ price = 100 * ( 1 - ( ( $ discount * $ daysBetweenSettlementAndMaturity ) / 360 ) ) ; if ( $ price <= 0 ) { return Functions :: NAN ( ) ; } return $ price ; } return Functions :: VALUE ( ) ; }
TBILLPRICE.

Returns the yield for a Treasury bill.

@param mixed $settlement The Treasury bill's settlement date.
The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer.
@param mixed $maturity The Treasury bill's maturity date.
The maturity date is the date when the Treasury bill expires.
@param int $discount The Treasury bill's discount rate

@return float
TBILLPRICE .