MCPcopy Create free account
hub / github.com/Pallinder/go-randomdata / StringNumberExt

Function StringNumberExt

random_data.go:263–277  ·  view source on GitHub ↗
(numberPairs int, separator string, numberOfDigits int)

Source from the content-addressed store, hash-verified

261}
262
263func StringNumberExt(numberPairs int, separator string, numberOfDigits int) string {
264 numberString := ""
265
266 for i := 0; i < numberPairs; i++ {
267 for d := 0; d < numberOfDigits; d++ {
268 numberString += fmt.Sprintf("%d", Number(0, 9))
269 }
270
271 if i+1 != numberPairs {
272 numberString += separator
273 }
274 }
275
276 return numberString
277}
278
279// StringNumber returns a random number as a string
280func StringNumber(numberPairs int, separator string) string {

Callers 4

EmailFunction · 0.85
StringNumberFunction · 0.85
TestRandomStringDigitsFunction · 0.85
ExampleRandomdataFunction · 0.85

Calls 1

NumberFunction · 0.85

Tested by 2

TestRandomStringDigitsFunction · 0.68
ExampleRandomdataFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…