|
Digits$ | ||
Result$ = Digits$(InputValue, Digits) | ||
Parameters: InputValue = The Value you wish to format to a zero padded string Digits = The number of digits the resulting string should have |
||
Returns: Result$ = the value converted to a padded string |
||
The Digits$() function is similar to the str$() function, except Digits$ will zero pad the resulting string for us. So we can be sure the resulting string will be a fixed length. FACTS: * This is handy when displaying/formatting numeric values to the screen, such as game scores and life counters. * If your value overflows the number of selected Digits to return, those decimal places will be lost. * Does not support negative values. Mini Tutorial: Display the numbers 1 to 10 zero padded to 4 digits.
This example would output.
|
Related Info: | Bin$ | Hex$ | Integer | Str$ | Val : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |