move formatfloat out of system (#20195)

* move formatfloat out of system

* fixes doc

* Update changelog.md

* careless

* fixes

* deprecate system/formatfloat

* better handling
This commit is contained in:
ringabout 2022-08-24 19:38:30 +08:00 • committed by GitHub
commit b6bfe38ff5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 201 additions and 176 deletions

View file

@ -4,8 +4,14 @@ runnableExamples:
assert $(-2*3) == "-6"
import std/private/[digitsutils, miscdollars]
import system/formatfloat
export addFloat
when not defined(nimPreviewSlimSystem):
import std/formatfloat
export addFloat
func `$`*(x: float | float32): string =
## Outplace version of `addFloat`.
result.addFloat(x)
proc `$`*(x: int): string {.raises: [].} =
## Outplace version of `addInt`.
@ -27,9 +33,6 @@ gen(int)
gen(uint64)
gen(int64)
func `$`*(x: float | float32): string =
## Outplace version of `addFloat`.
result.addFloat(x)
proc `$`*(x: bool): string {.magic: "BoolToStr", noSideEffect.}
## The stringify operator for a boolean argument. Returns `x`