diff --git a/build.gradle b/build.gradle index 4872614..d027fb3 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: "groovy" apply plugin: "maven" group = "com.jdbernard" -version = "1.2.1" +version = "1.2.2" repositories { mavenLocal() diff --git a/console_progress.nimble b/console_progress.nimble index c487463..3352c25 100644 --- a/console_progress.nimble +++ b/console_progress.nimble @@ -1,6 +1,6 @@ # Package -version = "1.2.1" +version = "1.2.2" author = "Jonathan Bernard" description = "Utility for writing dynamic progress bars to the console." license = "BSD" @@ -9,4 +9,3 @@ srcDir = "src/main/nim" # Dependencies requires "nim >= 0.13.0" - diff --git a/src/main/nim/console_progress.nim b/src/main/nim/console_progress.nim index 5f611b9..4a451f9 100644 --- a/src/main/nim/console_progress.nim +++ b/src/main/nim/console_progress.nim @@ -13,7 +13,7 @@ proc getMax*(pd: Progress): BiggestInt = proc setMax*(pd: Progress, maxValue: BiggestInt) = pd.maxValue = max(maxValue, 1) -proc newProgress*(sout: File, maxValue: BiggestInt): Progress = +proc newProgress*(maxValue: BiggestInt, sout: File = stdout): Progress = return Progress(sout: sout, startTime: cpuTime(), lastStep: 0, @@ -46,7 +46,7 @@ proc updateProgress*(pd: Progress, newValue: BiggestInt, info: string): void = '='.repeat(displayedSteps) & (if curStep > 0: "0" else: "") & '-'.repeat(pd.maxSteps - curStep) & " " & displayedInfo & " -- (" & - (curPercent * 100).formatFloat(ffDecimal, 2) & "%" + (curPercent * 100).formatFloat(ffDecimal, 2) & "%" if curPercent > 0.05: line &= ", "