function csl_number::ordinal in Bibliography Module 7.2
Same name and namespace in other branches
- 6.2 modules/CiteProc/CSL.inc \csl_number::ordinal()
- 7 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 1029
Class
Code
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;
}