diff --git a/Project.toml b/Project.toml index 5ec4b97c..c2338c9f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SpelledOut" uuid = "4728c690-e668-4265-bc0d-51a8c0f93067" authors = ["Jake W. Ireland and contributors"] -version = "0.1.1" +version = "1.0.1" [compat] julia = "1" diff --git a/src/SpelledOut.jl b/src/SpelledOut.jl index 9c0d3870..364385d5 100644 --- a/src/SpelledOut.jl +++ b/src/SpelledOut.jl @@ -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) diff --git a/test/runtests.jl b/test/runtests.jl index 594ace2b..3aad07ab 100755 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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