Page 1 of 1

print prints floating point with a comma

Posted: Wed Aug 04, 2021 9:16 am
by Nikki
Hi there, i have a new mac mini running big sur,

I pinpointed some issues i have to the following weirdness:

on my old machine

Code: Select all

print(1.123)
prints

Code: Select all

1.123
on the new machine it results in

Code: Select all

1,123
I dont understand why and its causing issues down the line, for example with string.format and tonumber()

It could be that there is something deeper even, because without print() the issue is there too, for example

Code: Select all

tonumber(string.format("%.3f", 1.123456))
this suddenly returns nil, where it should or did return 1.123

anyone know what todo about it ?

Re: print prints floating point with a comma

Posted: Wed Aug 04, 2021 9:43 am
by grump
What does

Code: Select all

os.setlocale(nil)
return?

If it's something other than "C", try

Code: Select all

os.setlocale("C")
to switch to the standard C locale. This should fix the issue.

Re: print prints floating point with a comma

Posted: Wed Aug 04, 2021 10:06 am
by Nikki
yes this fixed it, thx!