MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / formatPercent

Function formatPercent

music_hub/music_hub.ts:279–282  ·  view source on GitHub ↗
(fraction?: number)

Source from the content-addressed store, hash-verified

277 const safeFraction = clampFraction(fraction) ?? 0;
278 const filled = Math.round(safeFraction * PROGRESS_BAR_WIDTH);
279 return `${"█".repeat(filled)}${"░".repeat(PROGRESS_BAR_WIDTH - filled)}`;
280}
281
282function renderTransferProgress(song: ApiSong, update: TransferProgressUpdate): string {
283 const fraction = progressFraction(update);
284 const stageIcon = update.stage === "download" ? "⬇️" : "📤";
285 const stageText = update.stage === "download" ? "本地下载中" : "本地上传中";

Callers 1

renderTransferProgressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected