(seconds: number)
| 100 | const minutes = Math.floor((seconds % 3600) / 60); |
| 101 | const secs = Math.floor(seconds % 60); |
| 102 | return `${days.toString().padStart(2, '0')}天${hours.toString().padStart(2, '0')}小时${minutes.toString().padStart(2, '0')}分${secs.toString().padStart(2, '0')}秒`; |
| 103 | } |
| 104 | |
| 105 | // 计算日均使用量 |
| 106 | function calculateDailyUsage(totalUsed: number, startTime: number, currentTime: number): string { |
| 107 | const days = Math.max(1, (currentTime - startTime) / 86400); |
| 108 | return formatSize(totalUsed / days); |
| 109 | } |
| 110 | |
| 111 | // 计算剩余流量的建议日均用量 |
| 112 | function calculateRemainingDailyAllowance(remain: number, days: number): string { |
no outgoing calls
no test coverage detected