From 1996bf8db8970be6b83d1e9025891c750e71a9f6 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Thu, 8 Aug 2024 08:10:43 +0800 Subject: [PATCH] stdpkgprogress: np --- chore/stdpkgprogress/go_stdpkg_progress.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chore/stdpkgprogress/go_stdpkg_progress.go b/chore/stdpkgprogress/go_stdpkg_progress.go index 9817288..6059515 100644 --- a/chore/stdpkgprogress/go_stdpkg_progress.go +++ b/chore/stdpkgprogress/go_stdpkg_progress.go @@ -20,6 +20,7 @@ func main() { panic(err) } var done, total float64 + var ndone, ntotal int ret := doc.(githubisstask.Result) for _, task := range ret.Tasks { desc := task.Desc // fmt* (Imported By: 4513111) @@ -28,11 +29,14 @@ func main() { if n, e := strconv.Atoi(ntext); e == nil { w := math.Log2(float64(n) + 1) total += w + ntotal += n if task.Done { done += w + ndone += n } } } } - fmt.Printf("Progress: %.2f%%\n", done/total*100) + np := float64(ndone) / float64(ntotal) * 100 + fmt.Printf("Progress: %.2f%% (%.2f%%)\n", done/total*100, np) }