Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Oct 7, 2024
1 parent 3b0beab commit 90f8290
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/print.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ function _escape_if_scientific(::MIME"text/latex", x::String)
return "$(m[1]) \\times 10^{$(m[2])}"
end

_string_round(x) = _string_round(MIME("text/plain"), x)

# Helper function that rounds carefully for the purposes of printing Reals
# for example, 5.3 => 5.3, and 1.0 => 1
function _string_round(mode, x::Union{Float32,Float64})
Expand Down
3 changes: 3 additions & 0 deletions test/test_print.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,9 @@ function test_small_number_latex()
y = 0.23e-8 * x
@test function_string(MIME("text/latex"), y) == "2.3 \\times 10^{-9} x"
@test function_string(MIME("text/plain"), y) == "2.3e-9 x"
y = 1.23 * x
@test function_string(MIME("text/latex"), y) == "1.23 x"
@test function_string(MIME("text/plain"), y) == "1.23 x"
return
end

Expand Down

0 comments on commit 90f8290

Please sign in to comment.