Skip to content
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

Dev #13

Merged
merged 2 commits into from
Nov 1, 2020
Merged

Dev #13

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 Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SpelledOut"
uuid = "4728c690-e668-4265-bc0d-51a8c0f93067"
authors = ["Jake W. Ireland <jakewilliami@icloud.com> and contributors"]
version = "0.1.1"
version = "1.0.1"

[compat]
julia = "1"
Expand Down
2 changes: 1 addition & 1 deletion src/SpelledOut.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function small_convert(number::Integer; british::Bool=false, dict::Symbol=:moder
return word
end

v = 1
v = 0
while v < length(_tens)
d_cap = _tens[v + 1]
d_number = BigInt(20 + 10 * v)
Expand Down
14 changes: 7 additions & 7 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ using Test
@test Spelled_out(1234) == "One thousand, two hundred thirty-four"
@test Spelled_Out(1234) == "One Thousand, Two Hundred Thirty-Four"
@test SPELLED_OUT(1234) == "ONE THOUSAND, TWO HUNDRED THIRTY-FOUR"
@test spelled_out(123456789) == "one hundred thirty-three million, four hundred fifty-six thousand, seven hundred eighty-nine"
@test spelled_out(123456789, british=true) == "one hundred and thirty-three million, four hundred and fifty-six thousand, seven hundred and eighty-nine"
@test spelled_out(123456789) == "one hundred twenty-three million, four hundred fifty-six thousand, seven hundred eighty-nine"
@test spelled_out(123456789, british=true) == "one hundred and twenty-three million, four hundred and fifty-six thousand, seven hundred and eighty-nine"
@test spelled_out(0) == "zero"
@test spelled_out(0, british=true) == "zero"
@test spelled_out(100) == "one hundred"
@test spelled_out(100, british=true) == "one hundred"
@test spelled_out(123456789, british=true, dict=:european) == "one hundred and thirty-three million, four hundred and fifty-six thousand, seven hundred and eighty-nine"
@test spelled_out(123456789, dict=:european) == "one hundred thirty-three million, four hundred fifty-six thousand, seven hundred eighty-nine"
@test spelled_out(123456789, british=true, dict=:british) == "one hundred and thirty-three million, four hundred and fifty-six thousand, seven hundred and eighty-nine"
@test spelled_out(1234567890123, british=true, dict=:british) == "one billion, two hundred and thirty-four thousand million, five hundred and sixty-seven million, eight hundred and ninety thousand, one hundred and thirty-three"
@test spelled_out(1234567890123, british=true, dict=:modern) == "one trillion, two hundred and thirty-four billion, five hundred and sixty-seven million, eight hundred and ninety thousand, one hundred and thirty-three"
@test spelled_out(123456789, british=true, dict=:european) == "one hundred and twenty-three million, four hundred and fifty-six thousand, seven hundred and eighty-nine"
@test spelled_out(123456789, dict=:european) == "one hundred twenty-three million, four hundred fifty-six thousand, seven hundred eighty-nine"
@test spelled_out(123456789, british=true, dict=:british) == "one hundred and twenty-three million, four hundred and fifty-six thousand, seven hundred and eighty-nine"
@test spelled_out(1234567890123, british=true, dict=:british) == "one billion, two hundred and thirty-four thousand million, five hundred and sixty-seven million, eight hundred and ninety thousand, one hundred and twenty-three"
@test spelled_out(1234567890123, british=true, dict=:modern) == "one trillion, two hundred and thirty-four billion, five hundred and sixty-seven million, eight hundred and ninety thousand, one hundred and twenty-three"
end