minor changes

This commit is contained in:
rolux 2012-06-02 17:00:44 +02:00
parent ecd84770dd
commit 43558a55a3

View file

@ -465,7 +465,7 @@ Ox.formatDateRangeDuration = function(start, end, utc) {
/*@
Ox.formatDegrees <f> Formats degrees as D°MM'SS"
> Ox.formatDegrees(-111.11, 'lng')
"111\u00B006'36\"W"
"111°06'36\"W"
@*/
Ox.formatDegrees = function(degrees, mode) {
var days = 0,
@ -477,7 +477,7 @@ Ox.formatDegrees = function(degrees, mode) {
}
array[0] = days * 24 + parseInt(array[0], 10);
return (!mode ? sign : '')
+ array[0] + '\u00B0' + array[1] + "'" + array[2] + '"'
+ array[0] + '°' + array[1] + "'" + array[2] + '"'
+ (
mode == 'lat' ? (degrees < 0 ? 'S' : 'N')
: mode == 'lng' ? (degrees < 0 ? 'W' : 'E')
@ -608,13 +608,13 @@ Ox.formatOrdinal <f> Formats a number as an ordinal
Ox.formatOrdinal = function(number) {
var string = number.toString(),
length = string.length,
end = string[length - 1],
last = string[length - 1],
ten = length > 1 && string[length - 2] == '1';
if (end == '1' && !ten) {
if (last == '1' && !ten) {
string += 'st';
} else if (end == '2' && !ten) {
} else if (last == '2' && !ten) {
string += 'nd';
} else if (end == '3' && !ten) {
} else if (last == '3' && !ten) {
string += 'rd';
} else {
string += 'th';