User Tools

Site Tools


Action disabled: register
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. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
using_28_29_20format_20extended_20functionality.txt · Last modified: 2024/01/05 00:21 by 127.0.0.1