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.

CommentFileSizeAuthor
useful.png8.9 KBsteven jones
Command icon 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:

Comments

steven jones created an issue. See original summary.

steven jones’s picture

Status: Active » Needs review

I've added a floor in 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.

steven jones’s picture

Issue summary: View changes

marvil07’s picture

Status: Needs review » Fixed

Makes 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.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.