I need to display negative numbers as positive (i.e. just hide the negative sign)
For that I'm currently using this format
proc format;
* 9 forces leading zeros, 0 doesn't;
* numbers are inversed so high = low;
picture posval
low - high='000009.00'
;
run;
But the problem is that in a gtl plot I will have 2 decimal values on the axis. I can't change the format of the axis tickvalues back to no decimals.
Since my numbers range from -6 to 0 and none of them are exactly integers I figured something like this but it's totally inelegant and is more a hack than a solution.
proc format;
* 9 forces leading zeros, 0 doesn't;
* numbers are inversed so high = low;
picture posval
low -< -7 = '000009.00'
-7 -< -7 = '0009'
-7 -< -6 = '0009.00'
-6 -< -6 = '0009'
-6 -< -5 = '0009.00'
-5 -< -5 = '0009'
-5 -< -4 = '0009.00'
-4 -< -4 = '0009'
-4 -< -3 = '0009.00'
-3 -< -3 = '0009'
-3 -< -2 = '0009.00'
-2 -< -2 = '0009'
-2 -< -1 = '0009.00'
-1 -< -1 = '0009'
-1 -< -0 = '0009.00'
0 -< 0 = '000009'
0-high = '000009'
;
run;
Is there a better way?
EDIT:
A bit more information: I purposely invert my values to negatives to draw them as inverted bars on a barchartparm (sas GTL).
Why don't you use abs (absolute) function:
Output:
Also, share the input output data sets if you have any different requirement.