Skip to content

Commit 3009e33

Browse files
authored
Merge pull request #167 from FlTr/convert-string-to-float
Substitute comma with dot before conversion
2 parents 47468a8 + 32786a0 commit 3009e33

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

z.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
--
5151
-- Power Shell Install:
5252
-- * put something like this in your config file:
53-
-- Invoke-Expression (& {
53+
-- Invoke-Expression (& {
5454
-- (lua /path/to/z.lua --init powershell) -join "`n" })
5555
--
5656
-- Windows Install (with Clink):
@@ -405,7 +405,7 @@ if os.native.status then
405405
return hr ~= nil and ffi.string(buffer) or nil
406406
end
407407
end
408-
function os.native.tickcount()
408+
function os.native.tickcount()
409409
if windows then
410410
return os.native.GetTickCount()
411411
else
@@ -931,8 +931,8 @@ function os.environ(name, default)
931931
end
932932
elseif type(default) == 'number' then
933933
value = tonumber(value)
934-
if value == nil then
935-
return default
934+
if value == nil then
935+
return default
936936
else
937937
return value
938938
end
@@ -1076,6 +1076,7 @@ function data_load(filename)
10761076
local item = {}
10771077
if part and part[1] and part[2] and part[3] then
10781078
local key = insensitive and part[1]:lower() or part[1]
1079+
part[2] = part[2]:gsub(",", ".")
10791080
item.name = part[1]
10801081
item.rank = tonumber(part[2])
10811082
item.time = tonumber(part[3]) + 0
@@ -2088,7 +2089,7 @@ function z_clink_init()
20882089
end
20892090
local z_parser = clink.arg.new_parser()
20902091
z_parser:set_arguments({ z_match_completion })
2091-
z_parser:set_flags("-c", "-r", "-i", "--cd", "-e", "-b", "--add", "-x", "--purge",
2092+
z_parser:set_flags("-c", "-r", "-i", "--cd", "-e", "-b", "--add", "-x", "--purge",
20922093
"--init", "-l", "-s", "--complete", "--help", "-h")
20932094
clink.arg.register_parser("z", z_parser)
20942095
end
@@ -2731,7 +2732,7 @@ if os.lfs.enable ~= nil then
27312732
end
27322733
os.path.isdir = function (name)
27332734
local mode = lfs.attributes(name)
2734-
if not mode then
2735+
if not mode then
27352736
return false
27362737
end
27372738
return (mode.mode == 'directory') and true or false

0 commit comments

Comments
 (0)