Another point here I've been annoyed at: I don't think "%f" is what you exactly want when you cast to string. "%.*g" where * is the amount of digits you can have in the mantissa in (plus some) or so would probably be better in almost all cases. "%f" is typically bad in many cases:
> (string)1e-20; (9) Result: "0.000000"
