Skip to content

Commit 16446b1

Browse files
committed
Merge pull request #16 from czlee/master
When inserting Enums, only print the enum value, not the ::Type part
2 parents 024233b + 1b13f87 commit 16446b1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/fmtspec.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ immutable FormatSpec
3939
tsep::Bool # whether to use thousand-separator
4040

4141
function FormatSpec(typ::Char;
42-
fill::Char=' ',
42+
fill::Char=' ',
4343
align::Char='\0',
4444
sign::Char='-',
4545
width::Int=-1,
@@ -168,6 +168,10 @@ _srepr(x) = repr(x)
168168
_srepr(x::AbstractString) = x
169169
_srepr(x::Char) = string(x)
170170

171+
if isdefined(:Enum)
172+
_srepr(x::Enum) = string(x)
173+
end
174+
171175
function printfmt(io::IO, fs::FormatSpec, x)
172176
cls = fs.cls
173177
ty = fs.typ

0 commit comments

Comments
 (0)