summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/str.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/str.go b/lib/str.go
index 3c768ff..6938bfd 100644
--- a/lib/str.go
+++ b/lib/str.go
@@ -90,3 +90,12 @@ func NumToChar(n int64) byte {
return 0
}
+func NumToStr(n int64) string {
+ s := ""
+ for n != 0 {
+ s = string(NumToChar(n%10)) + s
+ n /= 10
+ }
+ return s
+}
+