This topic contains 1 reply, has 0 voices, and was last updated by michoel 8 years, 6 months ago.

  • Author
    Posts
  • #2030

    MNeedhamRyonet

    I am trying to not display a value when it is zero but comparison does not seem to be working

    I am looking at transaction.discounttotal the value seems to be null or missing so I would expect that (trasnaction.discounttotal)?has_content but for some reason it displays as $0.00 in my email that leads me to believe that transaction.discounttotal acutally have a value as a string (either $0.00 or 0.00) but when I try to convert that string to a number I get an error that it is not a number but com.netledger.templates.Empty.Model and when I try to say transaction.discounttotal?is_string != “0.00” that does not work

    How in the heck can I not display a cell in a table when the value appears to be null or empty but is not really null or empty
    This is a cached copy. Click here to see the original post.

  • #2031

    michoel

    The ‘is_string’ builtin is for testing the variable type, it won’t actually convert anything.

    You need to use ‘number’ to convert, and as some price values may contain formatting (currency sign, thousands separator etc.) you need to make sure to strip that out.

    Here is a function I use to convert prices to numbers.

    Code:

    Side point, should this forum be renamed ‘Advanced PDF/HTML Forms’ or ‘BFO / FTL’, as this is not actually a BFO question? rnedelkow


    rnedelkow replied on 05/12/2016, 07:14 PM: Thanks for the update. I’ll move the thread to the correct forum.

You must be logged in to reply to this topic.