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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with negitive number

Status
Not open for further replies.

jobillborf

Programmer
Feb 13, 2001
61
US
I have a field UNITCOST, which has both positive and negative numbers.

Can a formula be written that will convert the negative number to a positive, and if the number is positive leave it alone.
 
Hi,
Try

Code:
If {UNITCOST} < 0
 then 
   {UNITCOST} * -1
 else
   {UNITCOST)


[profile]
 
Why not just use the Abs function (returns the Absolute value)?

Abs({UNITCOST})

OR

if it just for display purposes, you can format the field to display it without the negative sign.

Right CLick on the field and choose Format Field
Choose the Number tab and click the Customize tab
In the drop down list next to negatives, choose &quot;None&quot;


~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top