Unsolved Reading Number
-
Hi!
Is it possible to let Qt Creator read double number like this -> 15,5 instead of 15.5
Because I'm using some formula and qDebug shows me 0 instead of the full number after the comma.I'm new to Qt, but I saw there is "replace" as method but it's only for QString (my number are initialize as double)
-
@aim0d
I presume you are talking about your Qt program, not Qt Creator? That is just an IDE for progam development.How (what code) are you using to convert a numerical string to a number? Or are you talking about typing that number somewhere in Creator??
-
Hi @aim0d, if you're meaning to handle the comma because that's the local user's format, you might like to try out QLocale::toDouble() - it'll interpret
,
and.
characters according the user's locale settings.Cheers.
-
@JonB Sorry, yes, i'm talking about Qt program.
I'm getting the number from QLineEdit in creator and getting in mainWindow asui->omug->text().toDouble();
But I have several operation that ends up being saved as several
double name = result
and I have to sum these result between themI dont know If I'm been clear, but english is not my first language and I'm trying to sum up my code to post it but having trouble
-
@Paul-Colby Yes, that what I was meaning. I'm gonna try thanks.