Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[3.0] [Form] IntegerType accepts floats - a bit misleading #10240

Closed
@jameshalsall

Description

@jameshalsall

The IntegerType supports floats, but as the name suggests it should only accept integers, i.e. whole numbers.

The NumberType supports floats, locale specific numeric strings (e.g. "40,000") etc.

I propose a change to these 2 types:

  • IntegerType: should be used for whole integers as the name suggests
  • NumberType: should be used for floats (rendering as an input[type="number"]), and have a new option (support_locale_strings or something similar) so that it renders as input[type="text"] and has the relevant attached NumberToLocalizedStringTransformer.

This is obviously a BC break so marked it for 3.0.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions