[Qt-interest] QString::toDouble with the string "Infinity"

Rüdiger Meier sweet_f_a at gmx.de
Thu Jun 25 13:12:57 CEST 2009


Hi,

On Monday 22 June 2009, Julien Cugnière wrote:
> It seems QString::toDouble knows how to convert a string such as
> "inf", "-inf", or "nan" into the corresponding double representation.

I've got a similar question because I need to convert strings to double, 
which were generated by Java's Double.toString, documented here:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Double.html#toString(double)

The Problem appears on the string "Infinity", which cannot be parsed by 
QString::toDouble.

Is there any way to reproduce that java behavior exactly in Qt4/C++?
Maybe QLocale::Javanese? ;)

cu,
Rudi




More information about the Qt-interest-old mailing list