How to determine which decimal separator is used

While playing around with the Signal Processing Toolkit, I found in NI’s sources a funny method to detect which decimal separator is used in the operating system — simply perform a conversion of the string “1,23” to a double and compare it to the double constant “1.23”.

image-20240504112347984

More information on NI Forum: ## Read Decimal Symbol “,” or “.”

And some variations:

or this:

or more simple:

or more hard, but tecnically accurate way using WinAPI: