User Tools

Site Tools


using_28_29_20format_20extended_20functionality

Using() Format Extended Functionality

LBB supports extended functionality for the using() function as is common in many other BASIC programming languages:

# 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. This occupies 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:

  print using("**$###,###.##-", -1234.567)

Outputs:

   ****$1,234.57-
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
using_28_29_20format_20extended_20functionality.txt · Last modified: 2018/04/14 14:03 by richardrussell