Skip to content

Commit

Permalink
fix: Converting type double to QString uses scientific counting
Browse files Browse the repository at this point in the history
  • Loading branch information
ice909 committed Jan 24, 2025
1 parent ad8de61 commit f1721e9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ bool fromJsonValue(QString &value, const QJsonValue &jval) {
} else if (jval.isBool()) {
value = jval.toBool() ? "true" : "false";
} else if (jval.isDouble()) {
value = QString::number(jval.toDouble());
value.setNum(jval.toDouble(), 'f', 0);
} else {
ok = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ bool fromJsonValue(QString &value, const QJsonValue &jval) {
} else if (jval.isBool()) {
value = jval.toBool() ? "true" : "false";
} else if (jval.isDouble()) {
value = QString::number(jval.toDouble());
value.setNum(jval.toDouble(), 'f', 0);
} else {
ok = false;
}
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-qt/client/PFXHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ bool fromJsonValue(QString &value, const QJsonValue &jval) {
} else if (jval.isBool()) {
value = jval.toBool() ? "true" : "false";
} else if (jval.isDouble()) {
value = QString::number(jval.toDouble());
value.setNum(jval.toDouble(), 'f', 0);
} else {
ok = false;
}
Expand Down

0 comments on commit f1721e9

Please sign in to comment.