新增評分項目設定、資料庫整合
This commit is contained in:
23
scripts/test-weight-display.js
Normal file
23
scripts/test-weight-display.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// 測試權重顯示格式
|
||||
const testWeights = [25.00, 20.00, 20.00, 15.00, 20.00];
|
||||
|
||||
console.log('🔄 測試權重顯示格式...');
|
||||
|
||||
// 計算總權重
|
||||
const totalWeight = testWeights.reduce((sum, weight) => sum + weight, 0);
|
||||
|
||||
console.log('個別權重:');
|
||||
testWeights.forEach((weight, index) => {
|
||||
console.log(` ${index + 1}. ${weight.toFixed(1)}%`);
|
||||
});
|
||||
|
||||
console.log(`\n總權重: ${totalWeight.toFixed(1)}%`);
|
||||
console.log(`是否等於 100%: ${totalWeight === 100 ? '✅' : '❌'}`);
|
||||
|
||||
// 測試權重顯示的各種格式
|
||||
console.log('\n權重顯示格式測試:');
|
||||
console.log(`原始格式: ${totalWeight}%`);
|
||||
console.log(`toFixed(1): ${totalWeight.toFixed(1)}%`);
|
||||
console.log(`toFixed(0): ${totalWeight.toFixed(0)}%`);
|
||||
|
||||
console.log('\n🎉 權重顯示格式測試完成!');
|
Reference in New Issue
Block a user