godotengine / godotengine/godot

Inspector numeric (esp. float) field filled with expression ending with dot (e.g. `100.` or `1/2.`) is rejected

Open
#90,593 1 comment 0 reactions 0 assignees View on GitHub
bug confirmed topic:core
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in: v4.2.1.stable.official [b09f793f5]

### System information

Godot v4.2.1.stable - Ubuntu 22.04.4 LTS 22.04 - X11 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 860M (nvidia; 535.161.07) - Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz (8 Threads)

### Issue description

Any input in a numerical inspector field ending with `.` is rejected (after pressing Enter, the previous value is restored).

This applies to both integer and float fields, but this is really problematic for float fields whereas this is a legit way to indicate we are dealing with a float. This is esp. useful to indicate a float division e.g. `3/2.`, since entering an integer division gives a Euclidian division (see https://github.com/godotengine/godot/issues/61956).

### Steps to reproduce

1. Take any numerical input field, but issue shows best on float fields
2. Enter some value such as `0.5`.
3. Enter `3/2.` (with trailing dot) => 0.5 remains, instead of expected 1.5
4. Enter `3./2` (dot on numerator) => 1.5 as expected

### Minimal reproduction project (MRP)

N/A

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in a numerical Inspector field using `3/2.` and compare it with `3./2`, as described in the steps. The work is done when integer and float fields accept valid expressions ending in a dot and no longer restore the previous value after pressing Enter.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.