# If statement to check answer

**URL:** <https://forum.kirupa.com/t/if-statement-to-check-answer/55989>\
**Category:** Uncategorized\
**Created:** [June 29, 2004, 6:35pm UTC](https://forum.kirupa.com/t/if-statement-to-check-answer/55989 "2004-06-29T18:35:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oldgreymare](https://avatars.discourse-cdn.com/v4/letter/o/838e76/32.png) [@oldgreymare](https://forum.kirupa.com/u/oldgreymare)\
**Post date:** [June 29, 2004, 6:35pm UTC](https://forum.kirupa.com/t/if-statement-to-check-answer/55989/1 "2004-06-29T18:35:29Z")

</div>

The user needs to submit a dollar amount answer. They could write is several ways. I’m trying to accomodate it with the code below. It always evaluates it as the wrong answer (the else).

Why won’t this code work?

```auto
submit_btn.onRelease = function(){
	if (answer_txt.text == "300 000" || answer_txt.text == "300000" || answer_txt.text == "300 000.00"){
		correct_txt.text = "Yes, the difference between savings is $300 000.00";
	}else{
		correct_txt.text = "That is incorrect. The difference between savings is $300 000.00";
		}
}

```

thanks if any one has any clues,
