08-02-2021 02:13 PM - edited 08-02-2021 02:19 PM
Hello everyone,
How to scan for a number regardless of whether decimal separator is a comma (,) or a dot (.)?
I am aware that you can specify one or the other (%. or %,), but how can I make that both "6,4" and "6.4" would be converted to a number?
Now I am using "Scan From String".
The only option I see is to replace all the dots by commas. Can it be natively done with "Scan From String"?
08-02-2021 02:29 PM - edited 08-02-2021 02:30 PM
@nicknamenickname wrote:
The only option I see is to replace all the dots by commas.
That's what I would do (except replace all commas with periods 😉 )
(I am sure you know that you can do it in one step when selecting "replace all=TRUE")
08-02-2021 03:10 PM
Hello nickname,
Can it be natively done with "Scan From String"?
Nope, not to my knowledge.
@nicknamenickname wrote:
Hello everyone,
How to scan for a number regardless of whether decimal separator is a comma (,) or a dot (.)?
I am aware that you can specify one or the other (%. or %,), but how can I make that both "6,4" and "6.4" would be converted to a number?
Now I am using "Scan From String".
The only option I see is to replace all the dots by commas.
I think that's one valid option. I sometimes implented a check it my number string contains a dot and then selected the appropiate format-string %.,%f or %,;%f
Regards, Jens