Skip to content

Commit a398c5f

Browse files
fix(log): print -0 when number = 0, closes #569 (#572)
1 parent 0d0079c commit a398c5f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/plenary/log.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ log.new = function(config, standalone)
9797
end
9898

9999
local round = function(x, increment)
100+
if x == 0 then
101+
return x
102+
end
100103
increment = increment or 1
101104
x = x / increment
102105
return (x > 0 and math.floor(x + 0.5) or math.ceil(x - 0.5)) * increment

0 commit comments

Comments
 (0)