Skip to content

Commit

Permalink
Removed leading underscores from internal functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewilliami committed Oct 23, 2020
1 parent 56e4915 commit f13a13a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/SpelledOut.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit f13a13a

Please sign in to comment.