Sha256: 6bb41abd5a56318366ca7bb3b466c52c9ce682fb8afddd8d098ca653574106cf

Contents?: true

Size: 693 Bytes

Versions: 4

Compression:

Stored size: 693 Bytes

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            Portions ©2008-2011 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

/**
 * Returns the ordinal associated for the current number.
 */
SC.methodForLocale('en', 'ordinalForNumber', function(number) {
  var d = number % 10;
  return (~~ (number % 100 / 10) === 1) ? 'th' :
         (d === 1) ? 'st' :
         (d === 2) ? 'nd' :
         (d === 3) ? 'rd' : 'th';
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/frameworks/core_foundation/english.lproj/ordinal.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/frameworks/core_foundation/english.lproj/ordinal.js
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/frameworks/core_foundation/english.lproj/ordinal.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/frameworks/core_foundation/english.lproj/ordinal.js