We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 018070e + 68ce2d0 commit 0266145Copy full SHA for 0266145
src/faker/provider/util.nim
@@ -1,6 +1,7 @@
1
import macros, random
2
from strformat import `&`
3
from strutils import join, align
4
+from math import `^`
5
6
macro genProc*(names, modules: untyped): untyped =
7
## プロシージャ定義を生成する。 `names` がプロシージャ名、 `modules` はプロシ
@@ -42,7 +43,8 @@ macro genProc*(names, modules: untyped): untyped =
42
43
44
proc formatNumbers*(r: var Rand, format: string): string =
45
proc alignFmt(r: var Rand, buf: string): string =
- let num = $r.rand(1..buf.len)
46
+ let max = 10 ^ buf.len - 1
47
+ let num = $r.rand(1..max)
48
result = num.align(buf.len, '0')
49
50
var buf: string
0 commit comments