Post Reply 
How do you use format
06-29-2016, 09:41 PM
Post: #1
How do you use format
How do you use format to format numbers into strings?

Code:

EXPORT HOWFMT()
BEGIN
 MSGBOX(format(9.3456,"s3"));
END;

Gives a bad argument error.

Stephen Lewkowicz (G1CMZ)
Visit this user's website Find all posts by this user
Quote this message in a reply
06-29-2016, 10:12 PM
Post: #2
RE: How do you use format
(06-29-2016 09:41 PM)StephenG1CMZ Wrote:  How do you use format to format numbers into strings?

The format command is a CAS command which Home doesn't know how to handle. So use CAS(format(9.3456,"s3")) when using it in a non-CAS program.

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
06-29-2016, 10:14 PM
Post: #3
RE: How do you use format
Try:

EXPORT HOWFMT()
BEGIN
MSGBOX(format(9.3456,QUOTE("s3")));
END;

-road
Find all posts by this user
Quote this message in a reply
06-30-2016, 07:12 AM (This post was last modified: 06-30-2016 07:13 AM by StephenG1CMZ.)
Post: #4
RE: How do you use format (SOLVED)
Thanks, both of those worked. I had tried CAS.format() instead of CAS(format()).

Stephen Lewkowicz (G1CMZ)
Visit this user's website Find all posts by this user
Quote this message in a reply
06-30-2016, 02:08 PM (This post was last modified: 06-30-2016 02:09 PM by toml_12953.)
Post: #5
RE: How do you use format
(06-30-2016 07:12 AM)StephenG1CMZ Wrote:  Thanks, both of those worked. I had tried CAS.format() instead of CAS(format()).

When should I use CAS.command and when should I use CAS(command) ?

Tom L

Tom L

If the First Presbyterian Church is nicknamed First Pres,
why isn't the First Methodist Church nicknamed First Meth?
Find all posts by this user
Quote this message in a reply
Post Reply 




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