Permalink
Fetching contributors…
Cannot retrieve contributors at this time
115 lines (81 sloc) 3.7 KB
<!DOCTYPE html>
<html>
<head>
<title>number_extensions.coffee</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>
<ul id="jump_to">
<li>
<a class="large" href="javascript:void(0);">Jump To &hellip;</a>
<a class="small" href="javascript:void(0);">+</a>
<div id="jump_wrapper">
<div id="jump_page_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>
</div>
</div>
</li>
</ul>
<ul class="sections">
<li id="title">
<div class="annotation">
<h1>number_extensions.coffee</h1>
</div>
</li>
<li id="section-1">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-1">&#182;</a>
</div>
</div>
<div class="content"><div class='highlight'><pre>inflect = <span class="hljs-built_in">require</span>(<span class="hljs-string">'../inflect'</span>)
<span class="hljs-function">
<span class="hljs-title">enableNumberExtensions</span> = -&gt;</span></pre></div></div>
</li>
<li id="section-2">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">&#182;</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 id="examples">Examples</h3>
<pre><code><span class="hljs-number">1.</span>ordinalize() <span class="hljs-comment"># =&gt; "1st"</span>
<span class="hljs-number">2.</span>ordinalize() <span class="hljs-comment"># =&gt; "2nd"</span>
<span class="hljs-number">1002.</span>ordinalize() <span class="hljs-comment"># =&gt; "1002nd"</span>
<span class="hljs-number">1003.</span>ordinalize() <span class="hljs-comment"># =&gt; "1003rd"</span>
</code></pre>
</div>
<div class="content"><div class='highlight'><pre> Number::ordinalize = <span class="hljs-function">-&gt;</span>
inflect.ordinalize(<span class="hljs-keyword">this</span>)
exports.enableNumberExtensions = enableNumberExtensions</pre></div></div>
</li>
</ul>
</div>
</body>
</html>