LB Booster
Programming >> Language extensions >> USING formats
http://lbb.conforums.com/index.cgi?board=extensions&action=display&num=1328119311

USING formats
Post by Richard Russell on Feb 1st, 2012, 5:01pm

LB4's USING() function doesn't support the full range of formatting options usually available from PRINT USING in other dialects of BASIC. LBB provides a much more complete set, as follows:

#The hash character is used to represent a digit position.
+A plus sign at the beginning or end of the template string causes the sign (+ or -) to be printed before or after the number.
A minus sign at the end of the template string causes negative numbers to be printed with a trailing minus sign.
**A double asterisk at the beginning of the template string causes leading spaces to be filled with asterisks. The ** specifies two digit positions.
$$A double dollar (or £) sign at the beginning of the template string causes a dollar (or £) sign to be printed to the immediate left of the number.
**$A **$ (or **£) at the beginning of the template string combines the effects of the previous two formats.
,A comma to the left of the decimal point in the template string causes a comma to be printed between every third digit before the decimal point.
^^^^Four carets may be placed after the digit characters to specify exponential format.

For example:

Code:
print using("**$#,###.##-", -1234.567) ' **$1,234.57- 

Richard.
Re: USING formats
Post by JosephE on Mar 14th, 2014, 6:11pm

I also took the liberty of adding this to the wiki: Using() Format Extended Functionality.