diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2022-08-24 19:38:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-24 13:38:30 +0200 |
commit | b6bfe38ff5283f77d5e5e78da06d2710bc16afb6 (patch) | |
tree | b1a8213c8627931d91737f27cb4bda48c8579657 /lib/system/dollars.nim | |
parent | 12f23d5ae8e4209dc9b1f40a0b792c6063ba78c5 (diff) | |
download | Nim-b6bfe38ff5283f77d5e5e78da06d2710bc16afb6.tar.gz |
move formatfloat out of system (#20195)
* move formatfloat out of system * fixes doc * Update changelog.md * careless * fixes * deprecate system/formatfloat * better handling
Diffstat (limited to 'lib/system/dollars.nim')
-rw-r--r-- | lib/system/dollars.nim | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/system/dollars.nim b/lib/system/dollars.nim index b060aedb0..4ff3d0ae6 100644 --- a/lib/system/dollars.nim +++ b/lib/system/dollars.nim @@ -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` |