Skip to content

Rounding mode should be towards zero. #52

@oscbyspro

Description

@oscbyspro

In response to changes upstream, fraction digits that exceed the maximum fraction digits length may round away from zero. This rarely matters, but sometimes the behavior may be unexpected. Assume

  • diffable text field is idle
  • value == 999.999
  • bounds == max
  • integer precision == 3
  • fraction precision == 2

so that when the user interacts with the view (editing changed counts as a change upstream) the following happens

  • bounds clamping rule applies: value == 999.999
  • the style formats the value (and implicitly rounds it up): number == "1,000"
  • precision rule applies: number is trimmed to "000" then converted: value == 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsum ting broke

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions