Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Suffix on Negative Numbers

Status
Not open for further replies.

fsreport

Programmer
Mar 23, 2007
128
US
The current choices to display a negative number are to use a minus sign or to add brackets around a negative number.Back in our old COBOL programming days, we often wanted to display a negative number with a “CR” suffix. A bank might want to display “OD” if your account balance dipped below zero.If you want to do this in your crystal report you can use the display string conditional formatting option. To display a CR against negative numbers use this conditional formatif CurrentFieldValue >= 0 then Totext(CurrentFieldValue) + " "else Totext(abs(CurrentFieldValue)) + "CR"One of the things to be careful about is that we really like to see numbers line up on the decimal place. With some fonts, each character has a different width. So you might need more than two spaces to get the alignment correct. Our test report found that four spaces worked well in Arial 10 point. You might need to experiment a little if you use a different font or size.

fsreport
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top