How to get decimal points in stead of decimal comma's

Thanks to the friendly support of Holger I succeeded in producing an output file with simulation data
by adding the necessary text lines to a schematic in Eeschema using the syntax:
wrdata ldf.dat vdb("/2")

I was however surprised to see that the data produced uses decimal comma notation whereas I expected decimal point notation. The strange thing is that using a ngspice-version (installed on the same Mint 19.2 system using apt install) which is not “embedded” in Kicad, I do get a decimal point notation. Is there a command to force the output to decimal point notation?

kind regards,
Hugo

I am using this version of KiCAD:
Version: 5.1.4-e60b266~84~ubuntu18.04.1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-58-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
Boost: 1.65.1
OpenCASCADE Community Edition: 6.9.1
Curl: 7.58.0
Compiler: GCC 7.4.0 with C++ ABI 1011

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

What is your OS locale setting?

1 Like

What is your OS locale setting?

LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=de_BE.UTF-8
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_BE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=de_BE.UTF-8
LC_NAME=de_BE.UTF-8
LC_ADDRESS=de_BE.UTF-8
LC_TELEPHONE=de_BE.UTF-8
LC_MEASUREMENT=de_BE.UTF-8
LC_IDENTIFICATION=de_BE.UTF-8
LC_ALL=

kind regards,
Hugo

I see “de” in numeric, so is this the cause?

1 Like

Most probably in the DE locale comma is the decimal separator and dot is used the thousand separator.

1 Like

It would be of interest to figure out what is happening here.

wrdata are written by ngspice with the fprintf funtion, whose output format depends on the locale setting of the process.

ngspice does not set any locale. So there is no switch to change the output behavior.

For stand-alone ngspice this means that its locale equivalent is “C”, with a dot decimal operator.

ngspice in eeschema is a dll depending on its parent process. I do not know if eeschema is explicitely setting its locale, for example by
setlocale(LC_ALL, "");
This would then lead eeschema (and ngspice dll) to take the OS settings.

1 Like

The DE locales are what you get after installing Mint 19.2 here in Belgium, but they don’t give
any unexpected results in other numerical programs (e.g. in the “apt-get installed” ngspice-version). Anyway, I changed it to en_US.UTF-8 but the resulting output still uses a decimal comma, not a decimal point.

FYI: I added the line export LC_NUMERIC=“en_US.UTF-8” to my .bashrc

kind regards,
Hugo

I found a workaround for the problem. I changed in EEschema in the Preferences–>Set Language
Default to English. This works, but I think the choice of the language should as such not have consequences for the preferred decimal representation, in my opinion it would be better to have a preference entry which gives you a choice between decimal representation with decimal point and decimal representation with a comma.

kind regards,
Hugo

We set LC_NUMERIC when we expect to be writing files. I don’t know that anyone expected ngspice to be writing data, so that isn’t set. It’s certainly straight-forward enough to fix. Can you submit a bug report?

I have submitted a bug report:

kind regards,
Hugo