Post Reply 
will this always return the current system decimal separator? (SOLVED)
02-05-2018, 08:32 AM (This post was last modified: 02-05-2018 11:23 PM by StephenG1CMZ.)
Post: #1
will this always return the current system decimal separator? (SOLVED)
I am not aware of a built-in "get the current decimal separator" function and I needed one because I have a program in which the system calls usually deliver "0." but ocassionally return "0".

So, I needed to find out whether to add a "." or a ",".

This seems to work - but could there be a "fix 0" mode which might hide the separator?
Code:

 EXPORT DecSepNow()
 //RETURN current system decimal separator
 BEGIN
  LOCAL ST:=STRING(π);//ANY REAL
  LOCAL DOT:=INSTRING(ST,".");
  LOCAL COM:=INSTRING(ST,",");
 
  RETURN MID(ST,MAX(DOT,COM),1);
 END;
Or is there a better way?

Stephen Lewkowicz (G1CMZ)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
will this always return the current system decimal separator? (SOLVED) - StephenG1CMZ - 02-05-2018 08:32 AM



User(s) browsing this thread: 1 Guest(s)