I have created an own product-attribute "height" in magento-backend. The input type is "text" (because there was no similar type like "float"). To use this attribute as a filter I wrote a small extension. In this extension I filter the products with
$this->_productCollection->addAttributeToFilter('height', array('lteq' => $height) );
When a products height is 69cm (69.00) and the filter is "<=80cm" (lteq 80.00) the filter works fine. But it doesn't work when the filter is "<=100cm" (lteq 100.00). This is because magento created the height-attribute as varchar and so the function addAttributeToFilter makes a string-compare. In string-compare "69" is greater than "100" because "6" is greater than "1".
Is there a way to tell addAttributeToFilter that it should compare the values as numbers instead of strings?
(I know the best way would be to delete the attribute and create a new one with type "float" via extension. But the shop is nearly finished and already contains products so I would like to avoid making such "big" changes in this state.)