Mistři v programování na #hovnokod

JavaScript #696

function CheckBankAccount(BIK, _Account) {
    var Mask = "71371371371371371371371";
    var Control = 0;
    var M;
    var strM;

    if (!BIK) {
        return true;
    }

    var Account = BIK.substring(6, 9) + _Account;

    for (var i = 0; i <= 22; i++) {
        M = RealParseInt(Account.substring(i, i+1))*RealParseInt(Mask.substring(i, i+1));
        strM = M.toString();
        Control += RealParseInt(strM.substring(strM.length-1, strM.length));
    }

    var R = ((Control/10) - Math.floor(Control/10));

    if (R == 0) {
        return true;
    }
    else {
        return false;
        }
}

HovnoKod,