Formatting money with a dollar sign
Posted: Thu Jul 04, 2019 6:55 am
Is there a way to ensure that the dollar sign is immediately to the left of an amount of money when output?
E.g.
X=12345
PRINT "$#####" : X
Prints $12345, which is fine.
But if X is 345 then it prints $ 345, inserting two spaces after the $ sign.
How can I ensure that the $ sign is immediately to the left of the first digit? In some versions of Basic using $$ solves the problem, but that doesn't appear to work in Smart Basic
E.g.
X=12345
PRINT "$#####" : X
Prints $12345, which is fine.
But if X is 345 then it prints $ 345, inserting two spaces after the $ sign.
How can I ensure that the $ sign is immediately to the left of the first digit? In some versions of Basic using $$ solves the problem, but that doesn't appear to work in Smart Basic