[Qt-interest] Convert a qreal to String

Sujan Dasmahapatra sdh at lmglasfiber.com
Thu Jun 18 11:56:15 CEST 2009


Thanks for the help Friends

Kind Regards,
Sujan Dasmahapatra
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Srdjan Todorovic
Sent: Thursday, June 18, 2009 2:57 PM
To: qt-interest
Subject: Re: [Qt-interest] Convert a qreal to String

Hi,

On 18/06/2009, Jesús Fernández Prieto <jsfdez at gmail.com> wrote:
> *QString strNumber;
>
> #if defined(__arm__)
> strNumber=QString::number(float(real));
> #else
> strNumber=QString::number(double(real));
> #endif

Why the extra cast?
And why the Arm difference?

Wouldn't the compiler for the Arm architecture already typedef double
to a float if it can't handle a double? Or can you use both but a
float is faster for that architecture?

Srdjan

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list