Skip to content

Commit

Permalink
Fix the printing of numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Garanas committed Mar 3, 2024
1 parent 3ac1df5 commit 203f8c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/system/dkson.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ end
updatedecpoint()

local function num2str (num)
return string.format("%.17g", num)
-- An overflowing number will return "1.#INF", so we need to get rid of the trailing period.
return replace(fsub(fsub(tostring(num), numfilter, ""), ".$", ""), decpoint, ".")
-- return replace(fsub(fsub(tostring(num), numfilter, ""), ".$", ""), decpoint, ".")
end

local function str2num (str)
Expand Down

0 comments on commit 203f8c9

Please sign in to comment.