Skip to content

Commit

Permalink
fix(log): print -0 when number = 0, closes nvim-lua#569 (nvim-lua…
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroSuero authored Apr 22, 2024
1 parent 0d0079c commit a398c5f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/plenary/log.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ log.new = function(config, standalone)
end

local round = function(x, increment)
if x == 0 then
return x
end
increment = increment or 1
x = x / increment
return (x > 0 and math.floor(x + 0.5) or math.ceil(x - 0.5)) * increment
Expand Down

0 comments on commit a398c5f

Please sign in to comment.