Bug 453819 - Edit negative float number and dot as separator
Summary: Edit negative float number and dot as separator
Status: RESOLVED FIXED
Alias: None
Product: okteta
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Friedrich W. H. Kossebau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-15 11:28 UTC by acc.gccquestions
Modified: 2022-05-16 11:01 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 0.26.8
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description acc.gccquestions 2022-05-15 11:28:34 UTC
Hi,

In the decoding table, when dealing with float values, we cannot enter negative floats.

Enter -75e-1 or -7.5 won't work.
Any negative value won't be registered.

You cannot enter 70.5 as well, but you must, instead, enter 705e-2.
Which is an annoyance. 

So the request is: 
we should be able to enter negative decimal values AND be able to enter decimal values directly (avoiding the scientific notation altogether).

Thanks,
Comment 1 Friedrich W. H. Kossebau 2022-05-15 17:55:56 UTC
This is only about 32-bit float, right? Thanks for reporting the bug, this seems to have been broken since the editing feature was added in 2009, either you are the first to actually use that or the first do care to report :) And I might have missed to properly test this when I added the edit code for float-32bit initially, and never looked at it again

Looking at details I learn even at my age that in C/C++ for float data types "min" actually has another meaning than what would transfer from integer data types, and instead some "lowest" is what to use here.

Also spotted the cause why post-decimal-points digits are not possible. 

So fix already sketched, will see to turn into working code the next days.

Related question: while looking at the feature (not used myself for some time) I see that values are not displayed localized. Any opinion against changing that to feature localized versions?
Comment 2 Friedrich W. H. Kossebau 2022-05-16 10:52:13 UTC
Though using localized data might want to be a config option rather, same as done in the Structures tool. So that part will not be touched, besides fixing the float editors to follow the non-locale value style.
Comment 3 Friedrich W. H. Kossebau 2022-05-16 11:01:33 UTC
Git commit 0d6ae65eae3eb184b8a5d223e5f40180fc4878a0 by Friedrich W. H. Kossebau.
Committed on 16/05/2022 at 10:56.
Pushed by kossebau into branch '0.26'.

POD decoder: fix float-32bit editor with negative values & decimal places

FIXED-IN:0.26.8

M  +3    -3    kasten/controllers/view/poddecoder/typeeditors/float32editor.cpp

https://invent.kde.org/utilities/okteta/commit/0d6ae65eae3eb184b8a5d223e5f40180fc4878a0