# Silly problem with a switch and numbers

**URL:** https://forum.kirupa.com/t/silly-problem-with-a-switch-and-numbers/296491
**Category:** Uncategorized
**Created:** [September 15, 2009, 4:49pm UTC](https://forum.kirupa.com/t/silly-problem-with-a-switch-and-numbers/296491 "2009-09-15T16:49:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cry4dawn](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@cry4dawn](https://forum.kirupa.com/u/cry4dawn)
#### Post date: [September 15, 2009, 4:49pm UTC](https://forum.kirupa.com/t/silly-problem-with-a-switch-and-numbers/296491/1 "2009-09-15T16:49:22Z")

</div>

I don’t understand why my switch statement isn’t working. Could somebody help me here im perplexed.

```auto

   var thisSquareFt:Number = (thisWidth*thisLength)/144   
   trace("square footage :" + thisSquareFt);
   
   //Find the pricing based on square footage
   switch(thisSquareFt) {
    case (thisSquareFt > 0 && thisSquareFt <=5):
     thisSquarePrice = 7;
     break;
    case (thisSquareFt > 5 && thisSquareFt <=10):
     thisSquarePrice = 6;
     break;
    case (thisSquareFt > 10 && thisSquareFt <=15):
     thisSquarePrice = 5;
     break;
    case (thisSquareFt > 15 && thisSquareFt <=30):
     thisSquarePrice = 4;   
     break;
    case (thisSquareFt > 30):
     thisSquarePrice = 3;   
     break;
    default :
     thisSquarePrice = 999
   }

```

So I can see from my trace that thisSquareFt is definitely a number yet none of my cases trigger. The value was NaN before I set a default. Why aren’t my conditional statements working?

Thanks
