From 98e377ab7f2a8435bfeb72846c3e5e17f8892454 Mon Sep 17 00:00:00 2001 From: jackokring Date: Tue, 26 Nov 2024 22:18:55 +0000 Subject: [PATCH] Tuesday 2024-11-26 22:18:55 --- lua/doris/module.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/doris/module.lua b/lua/doris/module.lua index 699160a..4233c5a 100644 --- a/lua/doris/module.lua +++ b/lua/doris/module.lua @@ -631,11 +631,11 @@ end ---to number with default C numeric locale ---@param str string ---@param base? integer ----@return number? +---@return number _G.val = function(str, base) local l = os.setlocale() os.setlocale("C", "numeric") - local s = tonumber(str, base or 10) + local s = tonumber(str, base or 10) or 0 os.setlocale(l, "numeric") return s end