Replies: 4 comments 5 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
-
Please, checkout #505 |
Beta Was this translation helpful? Give feedback.
1 reply
-
@Volosh1n 👋 Any estimate on when a new version with be released with this new module? |
Beta Was this translation helpful? Give feedback.
0 replies
-
@nan don't know. We don't have something like a release plan, just release if plenty of things were added. I think new version will be released soon. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I had preliminary discussion with @Volosh1n here: #498
After spending some time to try to migrate our (very large monolithic) codebase from
Faker
toFFaker
, I'm re-raising the issue because I'm starting to think it's worth it.Consider the following...
Throughout our codebase, we want to generate random numbers with specific lengths or formats. Keep in mind that because I want X digits, the leading digit cannot be a 0. This means, I can't simply do:
FFaker.numerify("###")
if I want a 3-digit number.This seems fine to me, and was the suggestion I found everywhere:
However, it gets (IMO) ugly fairly quickly:
There is the option of doing this...
But at that point, I feel like the intention of the code is completely lost. "Why do you have a single digit in the beginning?" "Why are you rand-ing 1 digit?" "How many #s is in there?" I just doesn't seem clear and simple.
The other useful helper in
Faker::Number
is:Again, leading zeros (and trailing ones) are important here, and we run in to the the same problem as above. But, again IMO, the intention and clarity of
Faker
is way better than any workaround you go with.In closing, can we please add a Number module/helper into
FFaker
? 🙇Beta Was this translation helpful? Give feedback.
All reactions