when i invoke toInt(), it return 0.
now i first use atoi(), and then QString::number();
but, it seems too much procedure???
how can i do that only using QString's method ?
thanks.
Printable View
when i invoke toInt(), it return 0.
now i first use atoi(), and then QString::number();
but, it seems too much procedure???
how can i do that only using QString's method ?
thanks.
Try
and then take the integer part!
:D
Alternatively, you can strip the decimals away from the string:
Works even if there isn't a decimal part, because str.left(-1) returns the whole string.
for me this should be enough:
i appreciate all the replyies ;)