This topic is locked
[SOLVED]

 Events snippet for "do not show" negative number..

6/26/2014 8:08:17 PM
PHPRunner General questions
N
nti author

I have a field in query "(SUM(Gross_Profit) - 25000.00) * (.05) AS 20% Share",
Sometimes the result/product produces a negative number example: -234.21
I have tried many diff code snippets to force negative numbers not to display... without success.
really could utilize a code snippet that will work in events, visual editor, or query designer...
all replies much appreciated... thank you...

Sergey Kornilov admin 6/26/2014

Try something like this in 'View as' Custom:

if ($value<0) {

$value="";

}
N
nti author 6/27/2014

Thank you Sergey, works perfect.