| 1 |
define([ |
| 2 |
"dojo/_base/lang", |
| 3 |
"../_base" |
| 4 |
], function(lang,dd){ |
| 5 |
|
| 6 |
var integers = lang.getObject("filter.integers", true, dd); |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
lang.mixin(integers, { |
| 14 |
add: function(value, arg){ |
| 15 |
value = parseInt(value, 10); |
| 16 |
arg = parseInt(arg, 10); |
| 17 |
return isNaN(arg) ? value : value + arg; |
| 18 |
}, |
| 19 |
get_digit: function(value, arg){ |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
value = parseInt(value, 10); |
| 27 |
arg = parseInt(arg, 10) - 1; |
| 28 |
if(arg >= 0){ |
| 29 |
value += ""; |
| 30 |
if(arg < value.length){ |
| 31 |
value = parseInt(value.charAt(arg), 10); |
| 32 |
}else{ |
| 33 |
value = 0; |
| 34 |
} |
| 35 |
} |
| 36 |
return (isNaN(value) ? 0 : value); |
| 37 |
} |
| 38 |
}); |
| 39 |
|
| 40 |
return integers; |
| 41 |
}); |