Diffstat (limited to 'frontend/gamma/js/MochiKit/Format.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/MochiKit/Format.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/frontend/gamma/js/MochiKit/Format.js b/frontend/gamma/js/MochiKit/Format.js index 122845e..58877e7 100644 --- a/frontend/gamma/js/MochiKit/Format.js +++ b/frontend/gamma/js/MochiKit/Format.js | |||
@@ -8,7 +8,7 @@ See <http://mochikit.com/> for documentation, downloads, license, etc. | |||
8 | 8 | ||
9 | ***/ | 9 | ***/ |
10 | 10 | ||
11 | MochiKit.Base._module('Format', '1.5', ['Base']); | 11 | MochiKit.Base.module(MochiKit, 'Format', '1.5', ['Base']); |
12 | 12 | ||
13 | MochiKit.Format._numberFormatter = function (placeholder, header, footer, locale, isPercent, precision, leadingZeros, separatorAt, trailingZeros) { | 13 | MochiKit.Format._numberFormatter = function (placeholder, header, footer, locale, isPercent, precision, leadingZeros, separatorAt, trailingZeros) { |
14 | return function (num) { | 14 | return function (num) { |
@@ -104,7 +104,7 @@ MochiKit.Format.numberFormatter = function (pattern, placeholder/* = "" */, loca | |||
104 | return [ | 104 | return [ |
105 | self.NAME, | 105 | self.NAME, |
106 | "(", | 106 | "(", |
107 | map(m.repr, args).join(", "), | 107 | m.map(m.repr, args).join(", "), |
108 | ")" | 108 | ")" |
109 | ].join(""); | 109 | ].join(""); |
110 | }; | 110 | }; |
@@ -142,7 +142,7 @@ MochiKit.Format.twoDigitAverage = function (numerator, denominator) { | |||
142 | 142 | ||
143 | /** @id MochiKit.Format.twoDigitFloat */ | 143 | /** @id MochiKit.Format.twoDigitFloat */ |
144 | MochiKit.Format.twoDigitFloat = function (aNumber) { | 144 | MochiKit.Format.twoDigitFloat = function (aNumber) { |
145 | var res = roundToFixed(aNumber, 2); | 145 | var res = MochiKit.Format.roundToFixed(aNumber, 2); |
146 | if (res.indexOf(".00") > 0) { | 146 | if (res.indexOf(".00") > 0) { |
147 | return res.substring(0, res.length - 3); | 147 | return res.substring(0, res.length - 3); |
148 | } else if (res.charAt(res.length - 1) == "0") { | 148 | } else if (res.charAt(res.length - 1) == "0") { |
@@ -193,7 +193,7 @@ MochiKit.Format.truncToFixed = function (aNumber, precision) { | |||
193 | fixed = MochiKit.Format._shiftNumber(fixed, 0); | 193 | fixed = MochiKit.Format._shiftNumber(fixed, 0); |
194 | } | 194 | } |
195 | return fixed; | 195 | return fixed; |
196 | } | 196 | }; |
197 | 197 | ||
198 | /** @id MochiKit.Format.roundToFixed */ | 198 | /** @id MochiKit.Format.roundToFixed */ |
199 | MochiKit.Format.roundToFixed = function (aNumber, precision) { | 199 | MochiKit.Format.roundToFixed = function (aNumber, precision) { |
@@ -205,7 +205,7 @@ MochiKit.Format.roundToFixed = function (aNumber, precision) { | |||
205 | fixed = MochiKit.Format._shiftNumber(str, -precision); | 205 | fixed = MochiKit.Format._shiftNumber(str, -precision); |
206 | } | 206 | } |
207 | return fixed; | 207 | return fixed; |
208 | } | 208 | }; |
209 | 209 | ||
210 | /** | 210 | /** |
211 | * Converts a number to a fixed format string. This function handles | 211 | * Converts a number to a fixed format string. This function handles |
@@ -221,7 +221,7 @@ MochiKit.Format.roundToFixed = function (aNumber, precision) { | |||
221 | MochiKit.Format._numberToFixed = function (aNumber, precision) { | 221 | MochiKit.Format._numberToFixed = function (aNumber, precision) { |
222 | var str = aNumber.toString(); | 222 | var str = aNumber.toString(); |
223 | var parts = str.split(/[eE]/); | 223 | var parts = str.split(/[eE]/); |
224 | var exp = (parts.length === 1) ? 0 : parseInt(parts[1]) || 0; | 224 | var exp = (parts.length === 1) ? 0 : parseInt(parts[1], 10) || 0; |
225 | var fixed = MochiKit.Format._shiftNumber(parts[0], exp); | 225 | var fixed = MochiKit.Format._shiftNumber(parts[0], exp); |
226 | parts = fixed.split(/\./); | 226 | parts = fixed.split(/\./); |
227 | var whole = parts[0]; | 227 | var whole = parts[0]; |
@@ -234,7 +234,7 @@ MochiKit.Format._numberToFixed = function (aNumber, precision) { | |||
234 | } else { | 234 | } else { |
235 | return whole; | 235 | return whole; |
236 | } | 236 | } |
237 | } | 237 | }; |
238 | 238 | ||
239 | /** | 239 | /** |
240 | * Shifts the decimal dot location in a fixed format number string. | 240 | * Shifts the decimal dot location in a fixed format number string. |
@@ -275,7 +275,7 @@ MochiKit.Format._shiftNumber = function (num, exp) { | |||
275 | num = "-" + num.substring(2); | 275 | num = "-" + num.substring(2); |
276 | } | 276 | } |
277 | return num; | 277 | return num; |
278 | } | 278 | }; |
279 | 279 | ||
280 | /** @id MochiKit.Format.percentFormat */ | 280 | /** @id MochiKit.Format.percentFormat */ |
281 | MochiKit.Format.percentFormat = function (aNumber) { | 281 | MochiKit.Format.percentFormat = function (aNumber) { |