From 9ae2c799ace7b5cce6673341b63f04713cb9978a Mon Sep 17 00:00:00 2001 From: "Jake W. Ireland" Date: Thu, 29 Oct 2020 03:58:48 +1300 Subject: [PATCH 1/2] Updated version number --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 5ec4b97c..4f625168 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.0" [compat] julia = "1" From e048afe609a056b25e358a4b802e5243443a0208 Mon Sep 17 00:00:00 2001 From: "Jake W. Ireland" Date: Sun, 1 Nov 2020 13:00:20 +1300 Subject: [PATCH 2/2] Bug fix (closes #12) --- Project.toml | 2 +- src/SpelledOut.jl | 2 +- test/runtests.jl | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Project.toml b/Project.toml index 4f625168..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 = "1.0.0" +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