jquery-src/jquery.calendars.js
function(digits, powers) {
			return function(value) {
				var localNumber = '';
				var power = 0;
				while (value > 0) {
					var units = value % 10;
					localNumber = (units === 0 ? '' : digits[units] + powers[power]) + localNumber;
					power++;
					value = Math.floor(value / 10);
				}
				if (localNumber.indexOf(digits[1] + powers[1]) === 0) {
					localNumber = localNumber.substr(1);
				}
				return localNumber || digits[0];
			}
		}
function(digits, powers) {
			return function(value) {
				var localNumber = '';
				var power = 0;
				while (value > 0) {
					var units = value % 10;
					localNumber = (units === 0 ? '' : digits[units] + powers[power]) + localNumber;
					power++;
					value = Math.floor(value / 10);
				}
				if (localNumber.indexOf(digits[1] + powers[1]) === 0) {
					localNumber = localNumber.substr(1);
				}
				return localNumber || digits[0];
			}
		}
function ( digits , powers ) { return function ( value ) { var localNumber = '' ; var power = 0 ; while ( value > 0 ) { var units = value % 10 ; localNumber = ( units === 0 ? '' : digits [ units ] + powers [ power ] ) + localNumber ; power ++ ; value = Math . floor ( value / 10 ) ; } if ( localNumber . indexOf ( digits [ 1 ] + powers [ 1 ] ) === 0 ) { localNumber = localNumber . substr ( 1 ) ; } return localNumber || digits [ 0 ] ; } }
Digit substitution function for localising Chinese style numbers via the Calendar digits option.
@member Calendars
@param digits {string[]} The substitute digits, for 0 through 9.
@param powers {string[]} The characters denoting powers of 10, i.e. 1, 10, 100, 1000.
@return {function} The substitution function.
Digit substitution function for localising Chinese style numbers via the Calendar digits option .