You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe it.
I had a need for product ratings/number of stars. A rating by by default is float with one decimal between 0 and 5. I.e. 3.6
For example, if proposing a new generator, explain why it's useful and relevant to Faker, and examples of how to use it in a real project.
Describe alternatives you've considered
I considered using Faker::Number.decimal, but I can't limit the range to 0-5, only the number of digits on each side of the decimal.
I've also considered creating this outside of Commerce so it can be used for a Book, App, Restaurant, etc., but decided to kept it as simple as possible.
Additional context
Since the return value is numeric, no translations are needed.
Updated docs
The text was updated successfully, but these errors were encountered:
I didn't see the checkbox to open an issue before writing any code, so I did things a bit out of order here and already opened a pr in #2808. Sorry about that.
No worries, thanks for the screenshot, that's neat! I left some comments in the PR.
I don't have lots of background with product ratings but you mention here that the default is a decimal. I've mostly seen integers, though. Mainly because I use the 5 start reviews when I rate something :P Would it be helpful to allow decimals but have an integer as the default?
Is your feature request related to a problem? Please describe it.
I had a need for product ratings/number of stars. A rating by by default is float with one decimal between 0 and 5. I.e. 3.6
For example, if proposing a new generator, explain why it's useful and relevant to Faker, and examples of how to use it in a real project.
Describe alternatives you've considered
I considered using Faker::Number.decimal, but I can't limit the range to 0-5, only the number of digits on each side of the decimal.
I've also considered creating this outside of Commerce so it can be used for a Book, App, Restaurant, etc., but decided to kept it as simple as possible.
Additional context
Since the return value is numeric, no translations are needed.
Updated docs
The text was updated successfully, but these errors were encountered: