You are here

private static function PHPExcel_Calculation_Financial::_daysPerYear in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Financial.php \PHPExcel_Calculation_Financial::_daysPerYear()

* _daysPerYear * * Returns the number of days in a specified year, as defined by the "basis" value * *

Parameters

integer $year The year against which we're testing: * @param integer $basis The type of day count: * 0 or omitted US (NASD) 360 * 1 Actual (365 or 366 in a leap year) * 2 360 * 3 365 * 4 European 360 * @return integer

6 calls to PHPExcel_Calculation_Financial::_daysPerYear()
PHPExcel_Calculation_Financial::COUPDAYBS in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Financial.php
* COUPDAYBS * * Returns the number of days from the beginning of the coupon period to the settlement date. * * Excel Function: * COUPDAYBS(settlement,maturity,frequency[,basis]) * * @access public * @category Financial Functions *
PHPExcel_Calculation_Financial::COUPDAYS in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Financial.php
* COUPDAYS * * Returns the number of days in the coupon period that contains the settlement date. * * Excel Function: * COUPDAYS(settlement,maturity,frequency[,basis]) * * @access public * @category Financial Functions *
PHPExcel_Calculation_Financial::COUPDAYSNC in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Financial.php
* COUPDAYSNC * * Returns the number of days from the settlement date to the next coupon date. * * Excel Function: * COUPDAYSNC(settlement,maturity,frequency[,basis]) * * @access public * @category Financial Functions *
PHPExcel_Calculation_Financial::PRICEMAT in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Financial.php
* PRICEMAT * * Returns the price per $100 face value of a security that pays interest at maturity. * *
PHPExcel_Calculation_Financial::YIELDDISC in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Financial.php
* YIELDDISC * * Returns the annual yield of a security that pays interest at maturity. * *

... See full list

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Financial.php, line 132

Class

PHPExcel_Calculation_Financial
PHPExcel_Calculation_Financial

Code

private static function _daysPerYear($year, $basis = 0) {
  switch ($basis) {
    case 0:
    case 2:
    case 4:
      $daysPerYear = 360;
      break;
    case 3:
      $daysPerYear = 365;
      break;
    case 1:
      $daysPerYear = PHPExcel_Calculation_DateTime::_isLeapYear($year) ? 366 : 365;
      break;
    default:
      return PHPExcel_Calculation_Functions::NaN();
  }
  return $daysPerYear;
}