Skip to content

Commit 2c64fbd

Browse files
authored
Updates for Julia 0.7.0-DEV.3199 (#20)
* Compat for `@sprintf` * Fix constructors no longer fall back to convert
1 parent 050790c commit 2c64fbd

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
julia 0.6
2-
Compat 0.33
2+
Compat 0.41

src/FixedPointDecimals.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ end
102102

103103
const FD = FixedDecimal
104104

105+
(::Type{T})(x::Real) where {T <: FD} = convert(T, x)
106+
105107
floattype(::Type{<:FD{T}}) where {T<:Union{Int8, UInt8, Int16, UInt16}} = Float32
106108
floattype(::Type{<:FD{T}}) where {T<:Integer} = Float64
107109
floattype(::Type{<:FD{BigInt}}) = BigFloat

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ using FixedPointDecimals
22
import FixedPointDecimals: FD, value
33
using Compat
44
VERSION < v"0.7.0-DEV.2047" && import Compat: Test
5+
import Compat.Printf: @sprintf
56
using Test
67
import Base.Checked: checked_mul
78

0 commit comments

Comments
 (0)