Feb 16, 2004 #1 ganjass Technical User Dec 30, 2003 154 GB CR9 HI All Is there a function that can detect the sign of a variable, ie +ve or -ve. cheers
Feb 16, 2004 #2 bdreed35 Programmer Mar 2, 2003 1,549 US I am not sure of a funciton, but you could easily write a formula that you could turn into a custom function. Try something like this: @Detect_The_Sign Code: if {table.number} >= 0 then "Positive" else "Negative" Of course you can change this to return what ever kind of value you need for your situation. ~Brian Upvote 0 Downvote
I am not sure of a funciton, but you could easily write a formula that you could turn into a custom function. Try something like this: @Detect_The_Sign Code: if {table.number} >= 0 then "Positive" else "Negative" Of course you can change this to return what ever kind of value you need for your situation. ~Brian
Feb 16, 2004 1 #3 Naith Programmer May 14, 2002 2,530 GB What you are trying to do is called finding the signum value. The Crystal function sgn does this. Upvote 0 Downvote