Move Float.parse examples right after Integer.parse
This commit is contained in:
@@ -39,6 +39,14 @@ defmodule Numbers do
|
||||
assert Integer.parse("2A", 16) == {___, ""}
|
||||
end
|
||||
|
||||
koan "Just want to parse to a float" do
|
||||
assert Float.parse("34.5") == {___, ""}
|
||||
end
|
||||
|
||||
koan "Hmm, I want to parse this but it has some strings" do
|
||||
assert Float.parse("1 million dollars") == {___, " million dollars"}
|
||||
end
|
||||
|
||||
koan "I don't want this decimal point, let's round up" do
|
||||
assert Float.ceil(34.25) == ___
|
||||
end
|
||||
@@ -55,14 +63,6 @@ defmodule Numbers do
|
||||
assert Float.floor(12.345, 2) == ___
|
||||
end
|
||||
|
||||
koan "Just want to parse to a float" do
|
||||
assert Float.parse("34.5") == {___, ""}
|
||||
end
|
||||
|
||||
koan "Hmm, I want to parse this but it has some strings" do
|
||||
assert Float.parse("1 million dollars") == {___, " million dollars"}
|
||||
end
|
||||
|
||||
koan "Round the number up or down for me" do
|
||||
assert Float.round(5.5) == ___
|
||||
assert Float.round(5.4) == ___
|
||||
|
||||
Reference in New Issue
Block a user