/
number_extensions.html
17 lines (12 loc) · 3.47 KB
/
number_extensions.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE html> <html> <head> <title>number_extensions.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To … <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="default_inflections.html"> default_inflections.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="inflections.html"> inflections.coffee </a> <a class="source" href="methods.html"> methods.coffee </a> <a class="source" href="number_extensions.html"> number_extensions.coffee </a> <a class="source" href="string_extensions.html"> string_extensions.coffee </a> <a class="source" href="version.html"> version.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> number_extensions.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="nv">inflect = </span><span class="nx">require</span><span class="p">(</span><span class="s1">'../inflect'</span><span class="p">)</span>
<span class="nv">enableNumberExtensions = </span><span class="o">-></span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">¶</a> </div> <p>Turns a number into an ordinal string used to denote the position in an
ordered sequence such as 1st, 2nd, 3rd, 4th.</p>
<h3>Examples</h3>
<pre><code>1.ordinalize() # => "1st"
2.ordinalize() # => "2nd"
1002.ordinalize() # => "1002nd"
1003.ordinalize() # => "1003rd"
</code></pre> </td> <td class="code"> <div class="highlight"><pre> <span class="nb">Number</span><span class="o">::</span><span class="nv">ordinalize = </span><span class="o">-></span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">ordinalize</span><span class="p">(</span><span class="k">this</span><span class="p">)</span>
<span class="nv">exports.enableNumberExtensions = </span><span class="nx">enableNumberExtensions</span>
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>