forked from shmuelie/Humanizer.Js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ordinalizeExtensions.js
49 lines (49 loc) · 2.33 KB
/
ordinalizeExtensions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var Humanizer;
(function (Humanizer) {
"use strict";
/** Turns a number into an ordinal string used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th. */
String.prototype.ordinalize = function (gender) {
/// <signature>
/// <summary>
/// Turns a number into an ordinal string used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th.
/// </summary>
/// </signature>
/// <signature>
/// <summary>
/// Turns a number into an ordinal string used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th.
/// </summary>
/// <param name="gender" type="Humanizer.GrammaticalGender">
/// The grammatical gender to use for output words
/// </param>
/// </signature>
if (gender === undefined) {
return Humanizer.Configuration.Configurator.getOrdinalizer().convert(parseInt(this, 10), this);
}
else {
return Humanizer.Configuration.Configurator.getOrdinalizer().convert(parseInt(this, 10), this, gender);
}
};
/** Turns a number into an ordinal number used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th. */
Number.prototype.ordinalize = function (gender) {
/// <signature>
/// <summary>
/// Turns a number into an ordinal string used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th.
/// </summary>
/// </signature>
/// <signature>
/// <summary>
/// Turns a number into an ordinal string used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th.
/// </summary>
/// <param name="gender" type="Humanizer.GrammaticalGender">
/// The grammatical gender to use for output words
/// </param>
/// </signature>
if (gender === undefined) {
return Humanizer.Configuration.Configurator.getOrdinalizer().convert(this, this.toString());
}
else {
return Humanizer.Configuration.Configurator.getOrdinalizer().convert(this, this.String(), gender);
}
};
})(Humanizer || (Humanizer = {}));
//# sourceMappingURL=ordinalizeExtensions.js.map