From f13a13ac55e6b113842db22b5cfbfeabcf603833 Mon Sep 17 00:00:00 2001 From: "Jake W. Ireland" Date: Sat, 24 Oct 2020 04:15:26 +1300 Subject: [PATCH] Removed leading underscores from internal functions --- src/SpelledOut.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SpelledOut.jl b/src/SpelledOut.jl index 5877508d..9c0d3870 100644 --- a/src/SpelledOut.jl +++ b/src/SpelledOut.jl @@ -6,7 +6,7 @@ include(joinpath(dirname(@__FILE__), "standard_dictionary_numbers_extended.jl")) include(joinpath(dirname(@__FILE__), "large_standard_dictionary_numbers_extended.jl")) # convert a value < 100 to English. -function __small_convert(number::Integer; british::Bool=false, dict::Symbol=:modern)::String +function small_convert(number::Integer; british::Bool=false, dict::Symbol=:modern)::String scale_numbers = _scale_modern # define scale type if number < 20 word = _small_numbers[number + 1] @@ -35,7 +35,7 @@ end # convert a value < 1000 to english, special cased because it is the level that excludes # the < 100 special case. The rest are more general. This also allows you to get # strings in the form of "forty-five hundred" if called directly. -function __large_convert(number::Integer; british::Bool=false, dict::Symbol=:modern)::String +function large_convert(number::Integer; british::Bool=false, dict::Symbol=:modern)::String scale_numbers = _scale_modern # define scale type word = string() # initiate empty string divisor = div(number, 100) @@ -55,7 +55,7 @@ function __large_convert(number::Integer; british::Bool=false, dict::Symbol=:mod end if modulus > 0 - word = word * __small_convert(modulus, british=british, dict=dict) + word = word * small_convert(modulus, british=british, dict=dict) end return word @@ -81,7 +81,7 @@ function spelled_out(number::Integer; british::Bool=false, dict::Symbol=:modern) end if number < 100 - word = __small_convert(number, british=british, dict=dict) + word = small_convert(number, british=british, dict=dict) if isnegative word = "negative " * word @@ -91,7 +91,7 @@ function spelled_out(number::Integer; british::Bool=false, dict::Symbol=:modern) end if number < 1000 - word = __large_convert(number, british=british, dict=dict) + word = large_convert(number, british=british, dict=dict) if isnegative word = "negative " * word @@ -108,7 +108,7 @@ function spelled_out(number::Integer; british::Bool=false, dict::Symbol=:modern) if d_number > number modulus = BigInt(big(1000)^(d_idx - 1)) l, r = divrem(number, modulus) - word = __large_convert(l, british=british, dict=dict) * " " * scale_numbers[d_idx - 1] + word = large_convert(l, british=british, dict=dict) * " " * scale_numbers[d_idx - 1] if r > 0 word = word * ", " * spelled_out(r, british=british, dict=dict)