Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
You might want to specify more info - version of EE? Version of Stash? Etc. Off the top of my head, i'm betting the issue is with your {if} statements, because those run in a deeply weird order in many versions of EE.
Well, then, there's definitely some kind of text-replacement routine running, either from a plugin or maybe an extension. Or possibly the actual field, if you're using something like wygwam?
Check the above edit and see if it solves your problem; I have ZERO idea how this will interact with anything, it's a really basic answer that addresses only the one place I know a specific numeric check is being done. There might be others; I don't know.