2D: Fix valuelabel formatting


AxisRenderer::formatValueLabel implementation did not work correctly
with format strings since it takes in the number as a double. Then it
ends up calling either QString::number or QString::asprintf with double.
However, only e, f, or g format strings work with double. Therefore, the
number parameter needs to be casted to int, if the format string
requires int argument.

This adds a format helper to CommonUtils which handles the conversion
to requested format.

Pick-to: 6.12
Fixes: QTBUG-148070
Change-Id: I2ff7cef6cf49bd552a428089aa5bfefbcf7c9416
Reviewed-by: Sami Varanka <sami.varanka@qt.io>
Reviewed-by: Owais Akhtar <owais.akhtar@qt.io>
commit4fafe2b247488865ef0b5b91c9e281489c2e7262
parent46f8a339fe208f3b90abf2ea634aa2b491e00c4d
authorSami Varanka <sami.varanka@qt.io>
committerSami Varanka <sami.varanka@qt.io>
commit timeFri, 25 Sep 2026 10:04:12 +0000