shawenguan 1 vuosi sitten
vanhempi
commit
c6db7147dd
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      Scripts/wubian/wubianScoreRank.js

+ 2 - 2
Scripts/wubian/wubianScoreRank.js

@@ -149,7 +149,7 @@ function padStringStart(inputString, totalLength, paddingChar = ' ') {
     let chineseLength = 0;
     const matches = inputString.match(chineseRegex);
     if (matches) {
-        chineseLength = matches.length;
+        chineseLength = Math.floor(matches.length * 1 / 2);
     }
 
     const stringLength = inputString.length + chineseLength;
@@ -170,7 +170,7 @@ function padStringEnd(inputString, totalLength, paddingChar = ' ') {
     let chineseLength = 0;
     const matches = inputString.match(chineseRegex);
     if (matches) {
-        chineseLength = matches.length;
+        chineseLength = Math.floor(matches.length * 1 / 2);
     }
 
     const stringLength = inputString.length + chineseLength;