You are here

public function csl_number::ordinal in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 modules/CiteProc/CSL.inc \csl_number::ordinal()
  2. 7.2 modules/CiteProc/CSL.inc \csl_number::ordinal()
2 calls to csl_number::ordinal()
csl_number::long_ordinal in modules/CiteProc/CSL.inc
csl_number::render in modules/CiteProc/CSL.inc

File

modules/CiteProc/CSL.inc, line 1372
CiteProc-PHP.

Class

csl_number

Code

public function ordinal($num) {
  if ($num / 10 % 10 == 1) {
    $num .= $this->citeproc
      ->get_locale('term', 'ordinal-04');
  }
  elseif ($num % 10 == 1) {
    $num .= $this->citeproc
      ->get_locale('term', 'ordinal-01');
  }
  elseif ($num % 10 == 2) {
    $num .= $this->citeproc
      ->get_locale('term', 'ordinal-02');
  }
  elseif ($num % 10 == 3) {
    $num .= $this->citeproc
      ->get_locale('term', 'ordinal-03');
  }
  else {
    $num .= $this->citeproc
      ->get_locale('term', 'ordinal-04');
  }
  return $num;
}