Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Function Index > F

FORMAT2

Scroll Prev Top Next More

(FORMAT2(arg,nchar1,nchar2,fill))

 

Formats a numeric value to a text string allowing a fill character to be loaded to the left of the numeric value. The two width arguments are used specify the total text string width and the characters to preserve right of decimal, including the decimal itself.

 

(FORMAT2(value, width1, width2, fill)) width1 = total width, width2 = one more than characters to right of decimal, fill = left fill character

 

Example 01:

 

SET VAR vFormatString TEXT = (FORMAT2(379.2418,14,3,'.'))

SHOW VAR vFormatString

..............379.24

 

Example 02:

 

SET VAR vFormatString TEXT = (FORMAT2(625.79,20,5,'*'))

SHOW VAR vFormatString

************625.7900