Hi Everybody,
I'm trying to Display Negative Numbers with ALL the following:
1) In RED
2) In Parenthesis
3) With a Minus Sign.

I'm using the CSpFormatter class, and it works for ONLY ONE of the above at a time.

Question: the method setNegativeNumbersStyle(int) accepts an int.  How do I "OR" the 
NEGATIVE_IN_COLOR, 
NEGATIVE_WITH_PARENS, and NEGATIVE_WITH_MINUS ??

Below is the Code I tried:


private String formatForDisplay(String s) {

        String formattedString = "";

        CSpFormatter csf = new CSpFormatter();

        csf.setType(CSpFormatter.NUMBER_TYPE);
        csf.setUse1000Separator(true);
        
        //int style = 
NEGATIVE_IN_COLOR.or(NEGATIVE_WITH_MINUS).or(NEGATIVE_WITH_PARENS);
        //int style = 
CSpFormatter.NEGATIVE_IN_COLOR.or(CSpFormatter.NEGATIVE_WITH_MINUS).or(CSpFormatter.NEGATIVE_WITH_PARENS);
                //csf.setNegativeNumbersStyle(style);


        //csf.setNegativeNumbersStyle(CSpFormatter.NEGATIVE_WITH_MINUS);
        csf.setNegativeNumbersStyle(CSpFormatter.NEGATIVE_IN_COLOR);
        //csf.setNegativeNumbersStyle(CSpFormatter.NEGATIVE_WITH_PARENS);

        try {
             formattedString = csf.format( (CSpString) new CSpString(s),false);
             CSpLog.send (this,CSpLog.ERROR,"Formatted STRING ==> " + formattedString 
);
        
        } catch(CSpFormatException e) {


             CSpLog.send (this,CSpLog.ERROR,"Format Error " + e );
        }


        return(formattedString);

        }
_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to