This shows you the differences between two versions of the page.
using_28_29_20format_20extended_20functionality [2018/03/31 13:19] 127.0.0.1 external edit |
using_28_29_20format_20extended_20functionality [2018/04/14 14:03] (current) richardrussell Tidied up formatting |
||
---|---|---|---|
Line 1: | Line 1: | ||
=====Using() Format Extended Functionality===== | =====Using() Format Extended Functionality===== | ||
- | ====== Using() Format Extended Functionality ====== | + | LBB supports extended functionality for the using() function as is common in many other BASIC programming languages: |
- | 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.\\ | | + | | # | 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 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 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 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 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 **$ (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.\\ | | + | | , | 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.\\ | | + | | ˆˆˆˆ | Four carets may be placed after the digit characters to specify exponential format.| |
- | \\ For example:\\ | + | |
+ | For example: | ||
+ | |||
+ | <code lb> | ||
print using("**$###,###.##-", -1234.567) | print using("**$###,###.##-", -1234.567) | ||
- | Outputs:\\ | + | </code> |
- | ****$1,234.57- | + | |
+ | Outputs: | ||
+ | |||
+ | <code> | ||
+ | ****$1,234.57- | ||
+ | </code> |