diff options
Diffstat (limited to 'lib/pure')
-rwxr-xr-x | lib/pure/strutils.nim | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index de555917c..382eece7b 100755 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -103,7 +103,7 @@ proc cmpIgnoreCase*(a, b: string): int {.noSideEffect, ## | 0 iff a == b ## | < 0 iff a < b ## | > 0 iff a > b - var i = 0 + var i = 0 var m = min(a.len, b.len) while i < m: result = ord(toLower(a[i])) - ord(toLower(b[i])) @@ -406,7 +406,7 @@ proc ParseInt*(s: string): int {.noSideEffect, procvar, ## Parses a decimal integer value contained in `s`. If `s` is not ## a valid integer, `EInvalidValue` is raised. var L = parseutils.parseInt(s, result, 0) - if L != s.len or L == 0: + if L != s.len or L == 0: raise newException(EInvalidValue, "invalid integer: " & s) proc ParseBiggestInt*(s: string): biggestInt {.noSideEffect, procvar, @@ -414,7 +414,7 @@ proc ParseBiggestInt*(s: string): biggestInt {.noSideEffect, procvar, ## Parses a decimal integer value contained in `s`. If `s` is not ## a valid integer, `EInvalidValue` is raised. var L = parseutils.parseBiggestInt(s, result, 0) - if L != s.len or L == 0: + if L != s.len or L == 0: raise newException(EInvalidValue, "invalid integer: " & s) proc ParseFloat*(s: string): float {.noSideEffect, procvar, @@ -423,7 +423,7 @@ proc ParseFloat*(s: string): float {.noSideEffect, procvar, ## a valid floating point number, `EInvalidValue` is raised. ``NAN``, ## ``INF``, ``-INF`` are also supported (case insensitive comparison). var L = parseutils.parseFloat(s, result, 0) - if L != s.len or L == 0: + if L != s.len or L == 0: raise newException(EInvalidValue, "invalid float: " & s) proc ParseHexInt*(s: string): int {.noSideEffect, procvar, @@ -952,7 +952,7 @@ type TFloatFormat* = enum ffDefault, ## use the shorter floating point notation ffDecimal, ## use decimal floating point notation - ffScientific ## use scientific notation (using ``e``) character + ffScientific ## use scientific notation (using ``e`` character) proc formatBiggestFloat*(f: BiggestFloat, format: TFloatFormat = ffDefault, precision = 16): string {.noSideEffect, @@ -1006,6 +1006,6 @@ when isMainModule: it goes""", 10, false) assert formatBiggestFloat(0.00000000001, ffDecimal, 11) == "0.00000000001" assert formatBiggestFloat(0.00000000001, ffScientific, 1) == "1.0e-11" - + assert "$# $3 $# $#" % ["a", "b", "c"] == "a c b c" |