Skip to content

[Panel] Number field removes decimal values when they are 0. #1748

@texnixe

Description

@texnixe

Describe the bug
When a number field is set to decimal values using the step option:

fields:
  price:
    label: Price
    type: number
    step: .01

and you select a number where the decimals are zero, e.g. 15,00, the zeros are removed when saving or reloading, also the number is stored without the decimals.

To Reproduce
Steps to reproduce the behavior:

  1. Add above field in any blueprint
  2. Visit page in panel and add number, e.g 15,00
  3. Save and reload
  4. See zeros vanishing. They are also not stored.

Expected behavior
Zeros should be stored in the content file and not disappear.

Kirby Version
3.1.3

https://forum.getkirby.com/t/decimal-number-fields-dont-allow-00-anymore/14066

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions