Skip to content

Commit

Permalink
Merge pull request #128 from prometheus-lua/levno-710-patch-1
Browse files Browse the repository at this point in the history
Update unparser.lua
  • Loading branch information
levno-710 committed Apr 18, 2023
2 parents c75599e + dd6bf39 commit 216b3f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/prometheus/unparser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,12 @@ function Unparser:unparseExpression(expression, tabbing)

if(expression.kind == AstKind.NumberExpression) then
local str = tostring(expression.value);
if(str == "inf") then
return "2e1024"
end
if(str == "-inf") then
return "-2e1024"
end
if(str:sub(1, 2) == "0.") then
str = str:sub(2);
end
Expand Down

0 comments on commit 216b3f4

Please sign in to comment.