Skip to content

Conversation

@xavier
Copy link
Contributor

@xavier xavier commented Jun 5, 2016

The documentation for Float.parse has a mention of String.to_float, this patch adds a similar reference for Integer.parse in the function documentation.

Raises an error if `base` is less than 2 or more than 36.
If an integer formatted string wants to be directly converted to a integer,
`String.to_integer/1` or `String.to_integer/2` can be used instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wording at the beginning of the sentence is kind of off (in the Float module as well, not your fault 😛). What if we say

If you want to convert a string-formatted integer directly to an integer, String.to_integer/1 or String.to_integer/2 can be used instead.

Same thing would go for the Float module, it would be great if you changed that as well in this PR :) Wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I totally agree. I found the wording a bit weird too but went for consistency first. But you're right, the boy scout rule should prevail, I'll update both docs.

@josevalim josevalim merged commit 4155e18 into elixir-lang:master Jun 5, 2016
@josevalim
Copy link
Member

❤️ 💚 💙 💛 💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants