summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSimon Hafner <hafnersimon@gmail.com>2014-02-11 17:00:22 -0600
committerSimon Hafner <hafnersimon@gmail.com>2014-02-11 17:46:34 -0600
commit33fcd112360c60078ae7ee4ddb93cbe9f44393bd (patch)
tree409c19b41801c2721908f1b05b83ce5a5d6b2eac
parent4b09baa0a030d899b7e75bb81828e0d9df90ce32 (diff)
downloadNim-33fcd112360c60078ae7ee4ddb93cbe9f44393bd.tar.gz
add a trailing zero to $float
-rw-r--r--lib/system/sysstr.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim
index a6a555c08..eb9d2000b 100644
--- a/lib/system/sysstr.nim
+++ b/lib/system/sysstr.nim
@@ -254,6 +254,8 @@ proc nimFloatToStr(x: float): string {.compilerproc.} =
   var buf: array [0..59, char]
   c_sprintf(buf, "%#.f", x)
   result = $buf
+  if result[len(result)-1] == '.':
+    result.add("0")
 
 proc nimInt64ToStr(x: int64): string {.compilerRtl.} =
   result = newString(sizeof(x)*4)