Skip to content

Progress bar: whole number zeroes are truncated #2647

Description

@ripexz

Overview of the problem

Buefy version: [8.20.0]
Vuejs version: [2.6.11]
OS/Browser: OSX 10.15.5 / Chrome 83.0.4103.116

Description

Not sure if this is really a bug or intended behaviour, however a Progress component set to 0 precision will truncate trailing zeroes on whole numbers, whereas I believe the intention is to only remove them on decimal numbers.
If I'm wrong, feel free to close the issue, though perhaps it's worth updating the documentation to clarify, but I think it's particularly confusing when dealing with percentages.

Steps to reproduce

  1. Set up a b-progress component with show-value="true", precision="0" and a whole value divisible by 10, e.g. value="100", e.g.:
<b-progress value="100" show-value="true" format="percent" precision="0" />

Expected behavior

Particularly for percentages, whole number should be displayed, i.e. in example above I would expect to see 100%.

Actual behavior

The trailing zeroes are trimmed on whole numbers, resulting in a confusing displayed value (again, particularly relevant for percentages), i.e. with the example input value of 100 the result is 1%:

image

This is even reproducible in the official documentation.

Note: This issue can be circumvented by passing keep-trailing-zeroes="true", however I still think it's a bug and should not require this workaround by default, 100.00 is the same value as 100 but 1 is not quite the same as 100 and changing the actual value seems misleading.

Activity

  1. added a commit that references this issue on Jul 7, 2020
    3aef674
  2. added a commit that references this issue on Jul 7, 2020
    1f4730f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions