Skip to content

fix: allow fractional input to start with a decimal separator - #108

Open
palmoni5 wants to merge 1 commit into
ubuntu-flutter-community:mainfrom
palmoni5:fix/leading-decimal-separator
Open

palmoni5 wants to merge 1 commit into
ubuntu-flutter-community:mainfrom
palmoni5:fix/leading-decimal-separator

Conversation

@palmoni5

Copy link
Copy Markdown

Problem

With decimals > 0, the formatter rejected ., -. and +., so users could not type .5.

Fix

Accept these prefixes; the number is validated once digits follow.

Tests

test/spin_formatter_test.dart.

CI on main currently fails in the Android example build and the publish dry-run; it goes green with #102.

With decimals > 0, SpinFormatter rejected ".", "-." and "+." because
they do not parse as numbers, so users could not type ".5" or "-.5"
and had to enter a leading zero first. Accept these incomplete prefixes;
the value is still validated once digits follow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant