Skip to content

Commit 38e386a

Browse files
committed
apply changes to format()
1 parent 314a4fb commit 38e386a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cformat.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ function generate_format_string(;
117117
String(append!(s, _codeunits(conversion)))
118118
end
119119

120+
function format(x::T; kwargs...) where T<:Number
121+
s = fmt_Number(x, x->format(AbstractFloat(x); kwargs..., width=-1))
122+
fmt(s, get(kwargs, :width, 0), get(kwargs, :leftjustified, false) ? :left : :right)
123+
end
124+
120125
function format( x::T;
121126
width::Int=-1,
122127
precision::Int= -1,

0 commit comments

Comments
 (0)