Skip to content

Commit

Permalink
Tuesday 2024-11-26 21:41:33
Browse files Browse the repository at this point in the history
  • Loading branch information
jackokring committed Nov 26, 2024
1 parent b677bbd commit 03752b6
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions lua/doris/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,27 @@ _G.rep = string.rep
_G.reverse = string.reverse
_G.sort = table.sort

_G.str = tostring
_G.val = tonumber
---to string with default C numeric locale
---@param number any
---@return string
_G.str = function(number)
local l = os.setlocale()
os.setlocale("C", "numeric")
local s = tostring(number)
os.setlocale(l, "numeric")
return s
end

---to number with default C numeric locale
---@param str string
---@return number?
_G.val = function(str)
local l = os.setlocale()
os.setlocale("C", "numeric")
local s = tonumber(str)
os.setlocale(l, "numeric")
return s
end

---quote a string escaped (includes beginning and end "\"" literal)
---@param str any
Expand Down

0 comments on commit 03752b6

Please sign in to comment.