Skip to content

[a11y] Improve formatting of decimals in base::NumberToString() #78460

@cbracken

Description

@cbracken

In //flutter/third_party/accessibility/base/string_utils.cc the NumberToString() functions taking float and double format the value using std::to_string() which emit strings such as "3.000000". Since these values are used by screen readers, we should probably truncate trailing zeros and format either as 3 (consistent with Chromium) or 3.0 (to indicate a decimal value).

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projecta: desktopRunning on desktopengineflutter/engine related. See also e: labels.platform-macBuilding on or for macOS specificallyplatform-windowsBuilding on or for Windows specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions