Problem/Motivation
If I select the 'Yes/No' widget and have some votes, then I get an output like this:

Which seems overly specific. I don't think I need to know that 65.217391304348% found that useful.
Maybe we should round to 1 or 2 or a configurable number of decimal places or significant figures?
Steps to reproduce
Use the Yes/No widget, and have a few votes that'll produce some kind of floating point percentage.
Proposed resolution
Maybe we should round to 1 or 2 or a configurable number of decimal places or significant figures?
Remaining tasks
Review the simple implementation.
User interface changes
The percentage displayed will change.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| useful.png | 8.9 KB | steven jones |
Issue fork vote_up_down-3610898
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3610898-yesno-widget-is
changes, plain diff MR !6
Comments
Comment #3
steven jones commentedI've added a
floorin there to round the percentage down, which makes it look nice and neat, and also avoids the situation where 100% isn't every single vote which some people might assume that it is.Comment #4
steven jones commentedComment #7
marvil07 commentedMakes sense, works nicely.
Thanks for starting with the simplest possible approach.
The periodic decimals are indeed not that helpful.
This may be changed again later, to add configurability, but if/when that happens, we can add an extra change.