nth

WebJar for nth

Лицензия

Лицензия

Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

nth
Последняя версия

Последняя версия

0.1.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

nth
WebJar for nth
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/mitchdenny/nth

Скачать nth

Имя Файла Размер
nth-0.1.3.pom
nth-0.1.3.jar 8 KB
nth-0.1.3-sources.jar 22 bytes
nth-0.1.3-javadoc.jar 22 bytes
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/nth/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>nth</artifactId>
    <version>0.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/nth/
implementation 'org.webjars.npm:nth:0.1.3'
// https://jarcasting.com/artifacts/org.webjars.npm/nth/
implementation ("org.webjars.npm:nth:0.1.3")
'org.webjars.npm:nth:jar:0.1.3'
<dependency org="org.webjars.npm" name="nth" rev="0.1.3">
  <artifact name="nth" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='nth', version='0.1.3')
)
libraryDependencies += "org.webjars.npm" % "nth" % "0.1.3"
[org.webjars.npm/nth "0.1.3"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.webjars.npm : validator jar [3.19.0,4)

Модули Проекта

Данный проект не имеет модулей.

nth

The 'nth' package contains a dirt simple module that takes an integer and then appends the appropriate place suffix. For example:

  • 1 becomes 1st
  • 2 becomes 2nd
  • 3 becomes 3rd
  • 4 becomes 4th
  • 13 becomes 13th
  • 23 becomes 23rd

Usage

Using the package is very easy. Just download it and install it via NPM:

npm install nth --save

Once the package is downloaded and installed, you just need to require in the module and call the appendSuffix method:

var nth = require('nth');
var output = nth.appendSuffix(23);
console.log(output); // outputs: '23rd'

If you just want to get the suffix itself (without the number) then you can call the getSuffix method.

var nth = require('nth');
var output = nth.getSuffix(23);
console.log(output); // outputs: 'rd'

Contributions

If you find a bug feel free to submit a pull request.

Known Limitations

Beyond the few obvious test cases I haven't spend any time on more complex scenarios like dealing with exponents. I can't imagine many folks really using this library in that context anyway :)

Версии библиотеки

Версия
0.1.3