Hi,

I need to convert float to QString so that all original digits (including 0's) are preserved. In the example below 100.0 becomes 100 and I don't want that. How would I do the conversion so that all digits are preserved?

The example shows where my floating number comes from and where it needs to go. I know it seems like running in a circle but my script requires this.
Qt Code:
  1. char TestChar[]="100.0";
  2. QString MyChar = TestChar;
  3. float TestFloat = MyChar.toFloat();
  4.  
  5. QString float_to_text;
  6. float_to_text.setNum(TestFloat);
To copy to clipboard, switch view to plain text mode 

Alternatively I'd like to know what is the best way to tell if an entry from a file is int or float? Does Qt offer such function? I'd like it to recognize "100.0" as a float.

Thanks!