fknop / angular-pipes

Useful pipes for Angular
https://fknop.gitbook.io/angular-pipes/
MIT License
732 stars 157 forks source link

Implement Ordinal Pipe #68

Closed tanayv closed 6 years ago

tanayv commented 6 years ago

This pipe will add an ordinal suffix (eg. st, nd, rd) to a number, which is useful for displaying ranks in leaderboards and so on.

Examples:

{{ 1 | ordinal }} <!-- 1st -->
{{ 22 | ordinal }} <!-- 22nd -->
{{ 523 | ordinal }} <!-- 523rd -->
{{ 15 | ordinal }} <!-- 15th -->
coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling e852b04fd1e6263ea86d03e444c59cdf36d289f5 on tanayv:ordinal-pipe into 06df035b292254bd2486f779fbfe40c1076f8346 on fknop:master.

tanayv commented 6 years ago

Made the changes! Thanks.