ordi
v1.0.3
Published
Easily get the ordinal 'st', 'nd', 'rd' or 'th' of cardinal numbers.
Downloads
10
Readme
_______ _______ ______
( ___ )( ____ )( __ \
| ( ) || ( )|| ( \ )
| | | || (____)|| | ) |
| | | || __)| | | |
| | | || (\ ( | | ) |
| (___) || ) \ \__| (__/ )
(_______)|/ \__/(______/
Gives you the 'st', 'nd', 'rd' or 'th' of a whole number.
Does not give you anything for zero, negative numbers, NaN, Infinity or real numbers (e.g. 3.14).
Does not give you anything for something which isn't a number.
Synopsis
var a = 21;
console.log('Happy ' + a + ord(a));
Will print out 'Happy 21st'.
Author
$ npx chilts
╒════════════════════════════════════════════════════╕
│ │
│ Andrew Chilton (Personal) │
│ ------------------------- │
│ │
│ Email : [email protected] │
│ Web : https://chilts.org │
│ Twitter : https://twitter.com/andychilton │
│ GitHub : https://github.com/chilts │
│ GitLab : https://gitlab.org/chilts │
│ │
│ Apps Attic Ltd (My Company) │
│ --------------------------- │
│ │
│ Email : [email protected] │
│ Web : https://appsattic.com │
│ Twitter : https://twitter.com/AppsAttic │
│ GitLab : https://gitlab.com/appsattic │
│ │
│ Node.js / npm │
│ ------------- │
│ │
│ Profile : https://www.npmjs.com/~chilts │
│ Card : $ npx chilts │
│ │
╘════════════════════════════════════════════════════╛
License
Copyright 2013-2019 Andrew Chilton. All rights reserved.
(Ends)