PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: Files4Mask()[Next]: FormatTime()
\ -> Rexx -> Inbuilt PPWIZARD Functions -> FormatNumber()

FormatNumber()

This is an inbuilt function function provided by PPWIZARD.

The purpose of this routine is to format a number. Note that the standard rexx function "format" can also do some number formatting.

This routine takes 2 parameters as follows:

  1. Number
    This is a number, an integer or a number with some decmal places (exampes "10" and "1.234").

  2. FormatSpec
    This is a string which contains codes which will get replaced by number information (more detail below). If not supplied the then commas are added to the number.

The return code is the formatted value.

FormatSpec

This is a string which may contain two character long control codes (all of which begin with "%"), if the control code is not recognised then it is ignored. The codes are:

Example

#DefineRexx ''
   N = 293842944

   ;--- Display number in MEG (to 4 decimal places) ---
   call say 'In MEG: ' || FormatNumber(N, "%,%M.%4")

   ;--- Display number with commas and byte/bytes ---------------------------
   call say 'Number: ' || FormatNumber(N, "%,%N %?byte,bytes;")
   call say '1     : ' || FormatNumber(1, "%,%N %?byte,bytes;")
#DefineRexx


email me  any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Search][Prev]: Files4Mask()[Next]: FormatTime()


PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Sunday November 05 2017 at 10:00am