Trouble converting string number to number with tonumber() function on [closed]
Hey guys,
i hope someone has an idea about my problem with the tonumber() function is
Problem:
I want to convert number that come from a text file that is loaded inside a dissector. On one PC with the current 4.2.6 release (also happening with 4.2.5) the basic code work, on the other one the result of the tonumber() function is nil
Test code:
local a = "-15.687"
local b = tonumber(a)
print("a " .. a)
print("b " .. b)
Below i copied the info on the about window from wireshark (both pc just got the newly release 4.2.6 installed)
About data of the PC where code works:
Version 4.2.6 (v4.2.6-0-g2acd1a854bab).
Compiled (64-bit) using Microsoft Visual Studio 2022 (VC++ 14.37, build 32822),
with GLib 2.78.0, with Qt 6.5.3, with libpcap, with zlib 1.3.0, with PCRE2, with
Lua 5.2.4 (with UfW patches), with GnuTLS 3.8.4 and PKCS #11 support, with
Gcrypt 1.10.2-unknown, with Kerberos (MIT), with MaxMind, with nghttp2 1.61.0,
with nghttp3 1.0.0, with brotli, with LZ4, with Zstandard, with Snappy, with
libxml2 2.11.5, with libsmi 0.5.0, with QtMultimedia, with automatic updates
using WinSparkle 0.8.0, with AirPcap, with Minizip, with binary plugins.
Running on 64-bit Windows 11 (23H2), build 22631, with AMD Ryzen 9 7950X 16-Core
Processor (with SSE4.2), with 65143 MB of physical memory, with GLib 2.78.0,
with Qt 6.5.3, with Npcap version 1.79, based on libpcap version 1.10.4, with
PCRE2 10.42 2022-12-11, with c-ares 1.27.0, with GnuTLS 3.8.4, with Gcrypt
1.10.2-unknown, with nghttp2 1.61.0, with nghttp3 1.0.0, with brotli 1.0.9, with
LZ4 1.9.3, with Zstandard 1.5.2, without AirPcap, with dark display mode, with
HiDPI, with QPA plugin "windows", with LC_TYPE=English_United Kingdom.utf8,
binary plugins supported.
About of PC which this doesn't work:
Version 4.2.6 (v4.2.6-0-g2acd1a854bab).
Compiled (64-bit) using Microsoft Visual Studio 2022 (VC++ 14.37, build 32822),
with GLib 2.78.0, with Qt 6.5.3, with libpcap, with zlib 1.3.0, with PCRE2, with
Lua 5.2.4 (with UfW patches), with GnuTLS 3.8.4 and PKCS #11 support, with
Gcrypt 1.10.2-unknown, with Kerberos (MIT), with MaxMind, with nghttp2 1.61.0,
with nghttp3 1.0.0, with brotli, with LZ4, with Zstandard, with Snappy, with
libxml2 2.11.5, with libsmi 0.5.0, with QtMultimedia, with automatic updates
using WinSparkle 0.8.0, with AirPcap, with Minizip, with binary plugins.
Running on 64-bit Windows 10 (22H2), build 19045, with 13th Gen Intel(R)
Core(TM) i7-13850HX (with SSE4.2), with 65136 MB of physical memory, with GLib
2.78.0, with Qt 6.5.3, with Npcap version 1.79, based on libpcap version 1.10.4,
with PCRE2 ...
Working output:
Is this what you get on the non-working system?
Could it be this? Non-working system has language set to
LC_TYPE=German_Germany.utf8
.http://lua-users.org/Re: How to extract a floating point number locale-independantly