12345.67
(1.95)
(23.47)
9876.57
This drove me nuts until I finally decided the design team had simply not thought of the possibility of properly stacking a column of numbers and leaving a space on the right for positives so things would line up. Having written the UDF some years ago, I've been using it ever since. Yours might go something like this (season to taste):PROCEDURE myFormat LPARAM TheNumber,ThePicture LOCAL lcRetVal lcRetVal = TRANS(ABS(TheNumber),ThePicture) IF TheNumber > 0 lcRetVal = " " + lcRetVal + " " ELSE lcRetVal = "(" + lcRetVal + ")" ENDIF RETURN "$ " + lcRetValExample uses would be:
Input Output ==================== ================= MyFormat(100,"999,999.99") $ 100.00 MyFormat(-20000,"999,999.99") $ ( 20,000.00) MyFormat(.59,"999,999.99") $ .59 MyFormat(-998457,"999,999.99") $ (998,457.00)Hope this helps.