JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 67
  • Score
    100M100P100Q61075F

Easily get the ordinal 'st', 'nd', 'rd' or 'th' of cardinal numbers.

Package Exports

  • ord

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ord) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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 : andychilton@gmail.com             │
   │            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 : chilts@appsattic.com              │
   │            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)