Skip to content

Commit

Permalink
Merge pull request #17 from jakewilliami/dev
Browse files Browse the repository at this point in the history
Began work on complex numbers (addresses #15)
  • Loading branch information
jakewilliami authored Nov 1, 2020
2 parents 82f42ce + cc43631 commit 965ed21
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/SpelledOut.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ function spelled_out(number::AbstractFloat; british::Bool=false, dict::Symbol=:m
end
end

function spelled_out(number::Complex; british::Bool=false, dict::Symbol=:modern)
return spelled_out(real(number), british=british, dict=dict) * " and " * spelled_out(imag(number), british=british, dict=dict) * " imaginaries"
end

Spelled_out(number::Number; british::Bool=false, dict::Symbol=:modern) = uppercasefirst(spelled_out(number, british=british, dict=dict))
Spelled_Out(number::Number; british::Bool=false, dict::Symbol=:modern) = titlecase(spelled_out(number, british=british, dict=dict))
SPELLED_OUT(number::Number; british::Bool=false, dict::Symbol=:modern) = uppercase(spelled_out(number, british=british, dict=dict))
Expand Down

0 comments on commit 965ed21

Please sign in to comment.