1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

去除 indexOf 校验逻辑;部分字符串解义

This commit is contained in:
程序员小墨 2024-05-26 23:13:34 +08:00
parent bfc500385f
commit 61c643ba44

View File

@ -979,10 +979,8 @@ function GetURLParams() {
while (match = regex.exec(url)) {
params[match[1]] = match[2]
}
if (url.indexOf('8jz') > -1) {
return params
}
}
function swap() {
var i1 = sel1elem.selectedIndex;
@ -1012,7 +1010,7 @@ function base2decimal(x, dec, b) {
d = parseInt(x[i], b);
e = idot - i - 1;
e = e.toString();
txt += "(" + d + " \u00D7 " + b + "<sup>" + e + "</sup>)";
txt += "(" + d + " × " + b + "<sup>" + e + "</sup>)";
if (i < len - 1) txt += " + "
}
if (minus) txt += "]";
@ -1036,7 +1034,7 @@ function decimal2base(dec, y, b) {
var nd = y.length - y.indexOf(".") - 1;
if (nd > 6) nd = 6;
if (id >= 0 && nd > 0) {
txt = "\u5c06\u76ee\u6807\u57fa\u6570\u4e58\u4ee5\u7ed3\u679c\u7684\u5c0f\u6570\u4f4d\u6570\u0028\u6700\u9ad8\u53ef\u8fbe\u0036\u4f4d\u6570\u0029\u003a<br>";
txt = "将目标基数乘以结果的小数位数(最高可达6位数):<br>";
txt += "floor(" + dec + "&times;" + b + "<sup>" + nd + "</sup>) = ";
dec = Math.floor(dec * Math.pow(b, nd));
txt += dec
@ -1073,8 +1071,8 @@ function onconvert() {
y = y.toString(b2).toUpperCase();
yelem.value = y;
var yd = yelem.value.match(/[\dA-Z]/g);
var ylabel = "\u8f6c\u6362\u7ed3\u679c\uff1a";
if (yd != null) ylabel += " (" + yd.length + ((yd.length == 1) ? " \u4f4d)" : " \u4f4d)");
var ylabel = "转换结果:";
if (yd != null) ylabel += " (" + yd.length + " 位)";
document.getElementById("ylabel").innerHTML = ylabel;
document.getElementById("b1txt").innerHTML = b1;
document.getElementById("b2txt").innerHTML = b2;