Skip to content

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

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy