Skip to content

Commit

Permalink
Added method handling irrational numbers (closes #38, but open questi…
Browse files Browse the repository at this point in the history
…on addressed in #48)
  • Loading branch information
jakewilliami committed Jan 27, 2021
1 parent cdba05f commit ddccd6b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/en.jl
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ function spelled_out_en(number::Rational; british::Bool = false, dict::Symbol =
return isone(_num) ? word : word * "s"
end

function spelled_out_en(number::AbstractIrrational; british::Bool = false, dict::Symbol = :modern)
throw(error("Please round the input number, as we support floating point printing but cannot support irrational printing."))
end

# Fallback method if we do not know how to handle the input
function spelled_out_en(number; british::Bool = false, dict::Symbol = :modern)
Expand Down

0 comments on commit ddccd6b

Please sign in to comment.