Che compilatore usi?
---EDIT---
Ma, tra parentesi, perché converti una stringa in un float e poi nuovamente in una stringa?