You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NumbersInWords.in_numbers("three and a half")# => 15.5
Weird maybe it's something with a three not being understood since it got the half right.
NumbersInWords.in_numbers("four and a half")# => 20.5
Nope that is not it. But just a half works:
NumbersInWords.in_numbers("half")# => 0.5
Must be the filler words:
NumbersInWords.in_numbers("a half")# => 0.5NumbersInWords.in_numbers("and a half")# => 0.5
Not without half:
NumbersInWords.in_numbers("three and")# => 3NumbersInWords.in_numbers("three and a")# => 31
Ah, now we are getting somewhere. So it's getting 31 then multiplying it by 0.5 to get 15.5? Maybe related to a?. Let's try taking the a out:
NumbersInWords.in_numbers("three and half")# => 1.5
Well, now it's not getting 31 but still multiplying by 0.5 instead of appending. This leads me to the questions:
Why does the filler words turn it into 31? - Looks like a is turns into 1 as an alias. So it parses this as the words "three" "one" "half". OK, at least 31 makes sense as it thinks I'm reading each number out?
Unexpected:
Weird maybe it's something with a three not being understood since it got the half right.
Nope that is not it. But just a half works:
Must be the filler words:
Not without half:
Ah, now we are getting somewhere. So it's getting 31 then multiplying it by 0.5 to get 15.5? Maybe related to
a
?. Let's try taking thea
out:Well, now it's not getting
31
but still multiplying by 0.5 instead of appending. This leads me to the questions:31
? - Looks likea
is turns into1
as an alias. So it parses this as the words "three" "one" "half". OK, at least31
makes sense as it thinks I'm reading each number out?0.5
instead of add? - Looks like that is just what the code tells it to do if a fraction is involved.So the parsing looks intentional and not a bug. So maybe the text I'm trying to give it is just not supported?
The text was updated successfully, but these errors were encountered: