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>