From 2754aecc02bb3de77b95ff15f819d23c073b5669 Mon Sep 17 00:00:00 2001 From: Sambit Kumar Dash Date: Mon, 14 Aug 2017 23:21:26 +0530 Subject: [PATCH] Added Base.convert --- src/AlphaNumNumeral.jl | 2 +- src/AlphaNumeral.jl | 2 +- src/LookupNumeral.jl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AlphaNumNumeral.jl b/src/AlphaNumNumeral.jl index d411ca4..43da20c 100644 --- a/src/AlphaNumNumeral.jl +++ b/src/AlphaNumNumeral.jl @@ -30,7 +30,7 @@ function Base.parse(::Type{AlphaNumNumeral}, str::String) return AlphaNumNumeral(val, str) end -function convert(::Type{AlphaNumNumeral}, val::Int) +function Base.convert(::Type{AlphaNumNumeral}, val::Int) carr = Vector{Char}() tval = val while (tval > 0) diff --git a/src/AlphaNumeral.jl b/src/AlphaNumeral.jl index 0fd5556..be8b6ec 100644 --- a/src/AlphaNumeral.jl +++ b/src/AlphaNumeral.jl @@ -35,7 +35,7 @@ function Base.parse(::Type{AlphaNumeral}, str::String) end end -function convert(::Type{AlphaNumeral}, val::Int) +function Base.convert(::Type{AlphaNumeral}, val::Int) if typemin(AlphaNumeral) <= val <= typemax(AlphaNumeral) n = div(val, 26) r = rem(val, 26) diff --git a/src/LookupNumeral.jl b/src/LookupNumeral.jl index 40f1c86..145c353 100644 --- a/src/LookupNumeral.jl +++ b/src/LookupNumeral.jl @@ -70,7 +70,7 @@ function Base.parse(::Type{LookupNumeral}, str::String) end end -function convert(::Type{LookupNumeral}, val::Int) +function Base.convert(::Type{LookupNumeral}, val::Int) if !haskey(LOOKUP_N2A, val) throw(DomainError()) else