-
-
Notifications
You must be signed in to change notification settings - Fork 22k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docs] Clarify that String
parsing methods don't support num separators
#97332
base: master
Are you sure you want to change the base?
Conversation
doc/classes/StringName.xml
Outdated
var a = "12.35".to_float() # a is 12.35 | ||
var b = "1.2.3".to_float() # b is 1.2 | ||
var c = "12xy3".to_float() # c is 12.0 | ||
var d = "1e3".to_float() # d is 1000.0 | ||
var e = "Hello!".to_float() # e is 0.0 | ||
var f = "1_2".to_float() # f is 1.0 (number separators are not supported) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part was using to_int
incorrectly so copied over the String
version for correctness while at it
Not sure this actually solves the mentioned issue, as this information is still hidden behind the String methods, which are not directly tied to the Expression class, at least not documented as such. |
It doesn't, hence why not linked, it's related and what inspired this change |
Also this should probably either be a note, the example should speak for itself without additional remarks in the same line, or both. As by the rest of this class reference page, you shouldn't need the code blocks to understand the methods. |
If says it only supports digits, so this is just "hey keep this one in mind" for those who miss that, it doesn't add any information the description doesn't have, just makes it clearer (it doesn't explicitly say "you can't put letters in a number") |
61408f1
to
703f714
Compare
703f714
to
ab1ccdf
Compare
…tors
Even if we chose to implement this in the future it'd be good to clear this up in 4.2 and 4.3, might easily be confusing as:
to_int
does ignore theseCan explicitly clarify the case in
Expression
but I think that class needs a more general clarification on how it works and what it does actually support so leaving it for now.See: