# parseFloat and if then statement

**URL:** <https://forum.kirupa.com/t/parsefloat-and-if-then-statement/37011>\
**Category:** flash\
**Created:** [December 4, 2003, 7:57pm UTC](https://forum.kirupa.com/t/parsefloat-and-if-then-statement/37011 "2003-12-04T19:57:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sparky\_J](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Sparky\_J](https://forum.kirupa.com/u/Sparky_J)\
**Post date:** [December 4, 2003, 7:57pm UTC](https://forum.kirupa.com/t/parsefloat-and-if-then-statement/37011/1 "2003-12-04T19:57:54Z")

</div>

I am trying to construct a simple input text box that is checked by a button. If the student types in 1077.63 he should get a “correct” message, and if not, an “incorrect” message. The problem is that I can’ t get AS to recognize the 1077.63. It will work when I use 177.63, 100.63, 7000.63; or what seems like ANY other number other than one I need! The code I’m using is listed below.

[AS]  
on (press)  
var a = a\_txt.length ? parseFloat(a\_txt.text) : 0;  
if (a==1077.63) {  
feedback = “Yes, you are correct.”;  
setProperty(equation, \_visible, true);  
} else {  
feedback = “No, that is incorrect.”;  
}  
}  
[/AS]

[AS]setProperty(equation, \_visible, false);  
a\_txt.restrict = “0-9.”;  
[/AS]
