Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/elixir/lib/float.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule Float do
If the size of float exceeds the maximum size of `1.7976931348623157e+308`,
the `ArgumentError` exception is raised.

If a float formatted string wants to be directly converted to a float,
If you want to convert a string-formatted float directly to a float,
`String.to_float/1` can be used instead.

## Examples
Expand Down
3 changes: 3 additions & 0 deletions lib/elixir/lib/integer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ defmodule Integer do

Raises an error if `base` is less than 2 or more than 36.

If you want to convert a string-formatted integer directly 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.


## Examples

iex> Integer.parse("34")
Expand Down