I have used
QString result
= QString("%1.%2").
arg(Time_ecu2uss
[0]/1000,
2,
10,
'0').
arg(Time_ecu2uss
[0] % 1000,
3,
10,
'0');
qDebug()<<"result"<<result;
QString result = QString("%1.%2").arg(Time_ecu2uss[0]/1000, 2,10,'0').arg(Time_ecu2uss[0] % 1000, 3,10, '0');
qDebug()<<"result"<<result;
To copy to clipboard, switch view to plain text mode
O/p
result "0.00000000000000000000000000000000000000000000000 0.0.0000000000000000000000000000000000000000000000 00"
result "0.00000000000000000000000000000000000000000000000 0.0.0000000000000000000000000000000000000000000000 00"
result "0.00000000000000000000000000000000000000000000000 0.0.0000000000000000000000000000000000000000000000 00"
result "0.00000000000000000000000000000000000000000000000 0.0.0000000000000000000000000000000000000000000000 00
When I Tried
QString result
= QString("%1.%2").
arg(Time_ecu2uss
[0]/1000,
2,
1,
'0').
arg(Time_ecu2uss
[0] % 1000,
3,
1,
'0');
qDebug()<<"result"<<result;
QString result = QString("%1.%2").arg(Time_ecu2uss[0]/1000, 2,1,'0').arg(Time_ecu2uss[0] % 1000, 3,1, '0');
qDebug()<<"result"<<result;
To copy to clipboard, switch view to plain text mode
o/p
result "0.00000000000000000000000000000000000000000000000 0.0.0000000000000000000000000000000000000000000000 00"
result "0.00000000000000000000000000000000000000000000000 0.0.0000000000000000000000000000000000000000000000 00"
result "0.00000000000000000000000000000000000000000000000 0.0.0000000000000000000000000000000000000000000000 00"
result "0.00000000000000000000000000000000000000000000000 0.0.0000000000000000000000000000000000000000000000 00"
result "0.00000000000000000000000000000000000000000000000 0.0.0000000000000000000000000000000000000000000000 00"
And I tried remove the thired argument .
QString result
= QString("%1.%2").
arg(Time_ecu2uss
[0]/1000,
2,
'0').
arg(Time_ecu2uss
[0] % 1000,
3,
'0');
qDebug()<<"result"<<result;
QString result = QString("%1.%2").arg(Time_ecu2uss[0]/1000, 2,'0').arg(Time_ecu2uss[0] % 1000, 3, '0');
qDebug()<<"result"<<result;
To copy to clipboard, switch view to plain text mode
o/p
result " 0. 0"
result " 0. 0"
result " 0. 0"
result " 0. 0"
result " 0. 0"
But i am not getting the format as 000.000,I am very new to Qt .
Bookmarks