This function formats numericExpression as a string using templateString. The rules for the format are similar to those in Microsoft BASIC's PRINT USING statement, but since using( ) is a function, it can be used as part of a larger BASIC expression instead of being useful only for display output directly. The template string consists of the character "#" to indicate placement for numerals, and a single dot "." to indicate placement for the decimal point. The template string must be contained within double quotation marks. If there are more digits contained in a number than allowed for by the template string, the digits will be truncated to match the template.

A template string looks like this:

amount$ = using("######.##", 1234.56)

As part of a larger expression:

notice "Your total is $" + using("####.##", 1234.5)

A template string can be expressed as a string variable:

template$ = "######.##"

amount$ = using(template$, 1234.56)

Using() may be used in conjunction with 'print'. The following two examples produce the same result:

amount$ = using("######.##", 123456.78)

print amount$

print using("######.##", 123456.78)

The using() function for Liberty BASIC 3 has been modified so that it rounds its output like PRINT USING does in other BASICs.