I am trying to find the values in a string using Indexof in ampscript.

           set @edt= "0,00"       
         set @displaySaving='initial'
  if IndexOf(@entryDiscountsTotal,@edt) > 0 then
             set @displaySaving='none'

It is totally working but the issue is I just wanted to check "0,00" I dont want to check if the value is "100,00" or "60,00" etc But the above code is considering all those values which includes 0,00. Can anyone help me how to solve this issue.

1 Answer 1


In that case, you should not use contains, but do a simple comparison:

SET @edt= "0,00"       
SET @displaySaving='initial'
IF @entryDiscountsTotal == @edt THEN
SET @displaySaving='none'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .