Fixed ftoa conversion function