Last active
November 25, 2016 10:40
-
-
Save fuggla/449e389f2efecb0d8acaabf0a27e7510 to your computer and use it in GitHub Desktop.
return number with swedish ordinal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Return swedish ordinal | |
* eg 1:a or 19:e | |
* Not needed if this is available: http://www.php.net/manual/en/class.numberformatter.php | |
**/ | |
function theme_slug_swedish_ordinal($number) { | |
$last = substr($number, -1); | |
if ($last <= 2) | |
return $number . ':a'; | |
else | |
return $number . ':e'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment