ID:2369228
 
Resolved
Parsing of numbers was incorrect in some cases where a similar number was available in a list of choices and a decimal point was in play.

When the parsing is for an input() in list() or argument in list() case, this is handled on the server. Therefore this fix impacts both the client and server.
BYOND Version:511
Operating System:Windows 10 Home 64-bit
Web Browser:Chrome 66.0.3359.139
Applies to:Dream Daemon & Dream Seeker
Status: Resolved (512.1425)

This issue has been resolved.
Descriptive Problem Summary:
When using inputs, the input refuses to acknowledge decimals if the possible inputs contain a whole integer and a decimal of said integer

Code Snippet (if applicable) to Reproduce Problem:
mob/verb/Bug_Test()
var/Egg= input("Choose the multi") in list(1, 1.5)
world<< "[Egg]"


Expected Results:
Egg would say 1.5

Actual Results:
Both options report Egg as 1

Does the problem occur:
Every time? Or how often?Every time
On other computers?Yes

Workarounds: Changing the multiplier of '1' to '0.999', not a desired workaround

Workarounds: Use the string values of "1" and "1.5" then convert back with text2num or by comparing the returned value manually.
In response to MrStonedOne
MrStonedOne wrote:
Workarounds: Use the string values of "1" and "1.5" then convert back with text2num or by comparing the returned value manually.

Elaborate please? I tried using text2num and it doesn't work unless I'm doing it wrong

    var/Egg= input("Choose the multi") in list("1", "1.5")
var/Egg2 = text2num(Egg)

That should be working, what do you get?
Both resulted in the same number in my formula. No errors were given in the program, but it ignores 1.5
Edit: Actually thinking on it, the text2num works but the same problem occurs. If text2num did not work, the end result would be 0 with a nulled value
mob/verb/Test()
var/Egg= input("Choose the multi") in list("1", "1.5")
var/Egg2 = text2num(Egg)
world<< "[Egg2]"
oh wtf. Lummox pls, you're killing me here!


/client/verb/test_input()
var/rtn = input("choose the thing") in list("thing", "thing2")
world << "1:`[rtn]`"
rtn = input("choose the thing again") in list("thing", "thing.2")
world << "2:`[rtn]`"


Choose the second option both times:

Expected:
1:`thing2`
2:`thing.2`

Actual:
1:`thing2`
2:`thing`
I suspect this is some weird holdover from ye olden BYOND where you can have multiple things with the same name in a list... and when typing the command in an input, you provide .# to specify which thing from the list. I'm pretty sure this is all parsed the same way.

Lummox JR resolved issue with message:
Parsing of numbers was incorrect in some cases where a similar number was available in a list of choices and a decimal point was in play.

When the parsing is for an input() in list() or argument in list() case, this is handled on the server. Therefore this fix impacts both the client and server.