Well, not quite, this will be 6 char long when positive and 7 char long when 
negative and the question was for a format which stays the same length. 
Unfortunately some data transfers still use fixed length fields (I've seen some 
with one space as a delimiter) and then this won't work.

Rainer

Phil:

In BASIC:

  OCONV((wkVal < 0), 'S;"-";""') : ABS(wkVal) "R(%6)"

In AQL (assuming value is in attribute/field 001):

DICT FILENAME  'TEST' size = 76
01 S
02 1
03 Value
04
05
06
07
08 AIF 1 < '0' THEN 1(S;'-';''):1(MCN)(MR%6) ELSE 1(MR%6)
09 R
10 7

Hope this helps.

Bill

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Phil Walker
> Sent: Wednesday, March 10, 2004 8:53 PM
> To: U2 Users Discussion List
> Subject: Formating Negative Numbers
>
>
> Does anyone have a quick way to format a negative number in a field filled
> with zeros such that the '-' sign appears at the front replacing the 1st
> zero.
>
> For example
>
> -2        using 'R%6' becomes 0000-2
> 2        using 'R%6' becomes 000002
>
> But I would like -2 to become -00002 and 2 to remain 000002.

<<snip>>
-- 
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to