PageSourceSearch

https://www.pelitatotobahu.net/assets/js/function.js

js pelitatotobahu.net collected 2026-10-09 22:40:47 UTC 2,310 bytes, 68 lines download raw bytes

1if (!Array.prototype.indexOf) {
2    Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
3        "use strict";
4        if (this === void 0 || this === null) {
5            throw new TypeError();
6        }
7        var t = Object(this);
8        var len = t.length >>> 0;
9        if (len === 0) {
10            return -1;
11        }
12        var n = 0;
13        if (arguments.length > 0) {
14            n = Number(arguments[1]);
15            if (n !== n) { // shortcut for verifying if it's NaN
16                n = 0;
17            } else if (n !== 0 && n !== Infinity && n !== -Infinity) {
18                n = (n > 0 || -1) * Math.floor(Math.abs(n));
19            }
20        }
21        if (n >= len) {
22            return -1;
23        }
24        var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
25        for (; k < len; k++) {
26            if (k in t && t[k] === searchElement) {
27                return k;
28            }
29        }
30        return -1;
31    }
32}
33
34function number_format (number, decimals, dec_point, thousands_sep) {
35    number = (number + '').replace(/[^0-9+\-Ee.]/g, '');
36    var n = !isFinite(+number) ? 0 : +number,
37        prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),        sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
38        dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
39        s = '',
40        toFixedFix = function (n, prec) {
41            var k = Math.pow(10, prec);            return '' + Math.round(n * k) / k;
42        };
43    // Fix for IE parseFloat(0.55).toFixed(0) = 0;
44    s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
45    if (s[0].length > 3) {        s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
46    }
47    if ((s[1] || '').length < prec) {
48        s[1] = s[1] || '';
49        s[1] += new Array(prec - s[1].length + 1).join('0');    }
50    return s.join(dec);
51}
52
53function desimal(nilai,digit){
54	digit = (digit != undefined) ? digit : 0;
55	result = number_format(nilai,digit,'.',',');
56	return result;
57}
58
59function str_replace(haystack, needle, replacement) {
60	haystack = (haystack != undefined) ? haystack : "";
61	var temp = haystack.split(needle);
62	return temp.join(replacement);
63}
64
65function toNum(t) {
66var a = str_replace(t,',','');
67return a
68}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.