Skip to content

Commit

Permalink
fix: incorrect conversion for wide decimal
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Ivaschenko committed Jan 21, 2025
1 parent f16384b commit 8b95577
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions qd_proto/format/wide_decimal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ function wide_decimal.to_double(val)
else
exp = tostring(significand) .. "e" .. (const.BIAS - rank)
end

if exp:match("%.0$") then
exp = exp:sub(1, #exp - 2)
end

-- Converts to number.
return tonumber(exp)
Expand Down

0 comments on commit 8b95577

Please sign in to comment.