So my problem is that php is not casting these types correctly.. I need to figure out a better way of doing it than number 3, if there is one, and I'd really like to know why PHP treats the comma as a period or something.
$cost = "7,800.00"; // "7,800.00"
$cost = (int) "7,800.00" // int(7)
$cost = (int) preg_replace('/[^-0-9\.]/i', '', "7,800.00"); // int(7800)
Edit, to make things clear to those who don't read: I'm looking for a more elegant way to do this. As far as why this behavior exists, I've already gotten the explanation I was looking for. Thanks.