Skip to content

Commit ed0096a

Browse files
committed
Anchor remove-trailing-zeros regexps
Prevents 2.04 from being changed to 24.
1 parent 4d39cb3 commit ed0096a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/trials.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,10 @@ function Base.show(io::IO, ::MIME"text/plain", t::Trial)
466466
end
467467

468468
function remtrailingzeros(timestr)
469-
if ! isnothing(match(r"\.0+", timestr))
470-
replace(timestr, r"\.0+" => "")
469+
if ! isnothing(match(r"\.0+$", timestr))
470+
replace(timestr, r"\.0+$" => "")
471471
else
472-
replace(timestr, r"(\.\d+?)0+" => s"\1")
472+
replace(timestr, r"(\.\d+?)0+$" => s"\1")
473473
end
474474
end
475475
minhisttime, maxhisttime = remtrailingzeros.(prettytime.(round.(histtimes[[1; end]], sigdigits=3)))

0 commit comments

Comments
 (0)