Format$
Takes two parameters, a source value, and a formatting mask.
Description:
Format a numeric value using a custom mask
Mask Options:
- 0 indicates a digit position that will always be shown, even if that value is zero
- # indicates a digit position that will only be shown if it there are enough digits to fill it
- #, at the start of a mask indicates that a , should be inserted every three digits on the left side of the decimal point
- , may also be used in between specified 0s and #s
- . indicates the decimal point position
- % at the end of a mask will multiply the number by 100 and add the % sign
Examples:
[New] MyVal = 123.456
Html (Format$ MyVal, "0000.0") '0123.5
Html (Format$ MyVal, "###0.0") '123.5
Html (Format$ (MyVal * 1000), "#,.00") '123,456.00
Html (Format$ (MyVal / 1000), "0.00%") '12.34%