Format string with PRINT command
Posted: Fri Jan 15, 2021 8:55 pm
The format string with the print command can be very useful when formatting numbers.
However, when formatting large numbers using the comma for thousands, millions, and billions separator character, the following occurs:
a=1234567
print "###,###,###":a
' yields: 1,234,567
a=672
print "###,###,###":a
' yields: , ,672
Is there an easy way to format this correctly? That is, a way to eliminate the leading commas?
However, when formatting large numbers using the comma for thousands, millions, and billions separator character, the following occurs:
a=1234567
print "###,###,###":a
' yields: 1,234,567
a=672
print "###,###,###":a
' yields: , ,672
Is there an easy way to format this correctly? That is, a way to eliminate the leading commas?