diff --git a/changelog.md b/changelog.md index 30d9c6f2ba..60e9933596 100644 --- a/changelog.md +++ b/changelog.md @@ -20,6 +20,9 @@ containing the column of the instantiation. - ``cookies.setCookie` no longer assumes UTC for the expiration date. +- ``strutils.formatEng`` does not distinguish between ``nil`` and ``""`` + strings anymore for its ``unit`` parameter. Instead the space is controlled + by a new parameter ``useUnitSpace``. #### Breaking changes in the compiler diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index ddd0e9e620..7b8a9a0d04 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -2144,12 +2144,13 @@ proc formatEng*(f: BiggestFloat, precision: range[0..32] = 10, trim: bool = true, siPrefix: bool = false, - unit: string = nil, - decimalSep = '.'): string {.noSideEffect.} = + unit: string = "", + decimalSep = '.', + useUnitSpace = false): string {.noSideEffect.} = ## Converts a floating point value `f` to a string using engineering notation. ## ## Numbers in of the range -1000.0