Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- GT_LIB v1.0 Reference Guide Release 1.0 - <b>convert a numeric to a string padded with leading zeros</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Convert a numeric to a string padded with leading zeros
------------------------------------------------------------------------------

 Syntax

        GT_StrZero( nNumber , nLength , nDecimals )

 Arguments:

      nNumber   - Number to convert
      nLength   - Length of string required - Optional if nDecimals noy used
      nDecimals - Number of decimals to simulate - Optional

 Returns:

      A string padded with zeroes to the left

 Description:

      Takes a number and converts it to a string.  If nLength is specified
      the string is left padded with zeroes.
      If nDecimals is specified, the string will have that many decimal
      places

 Examples:

      GT_StrZero( 5 , 2 )       -> "05"
      GT_StrZero( 300 , 8 , 2 ) -> "00300.00"

 Source: STRZERO.PRG

 Author:  Martin Colloby

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson