Menu

#12 Strange roundoff behavior for axis points

v1.0_(example)
closed
nobody
None
1
2016-11-21
2014-01-14
No

Strange effect with version 5.2 and 5.1 on Ubuntu Linux 13.04.
I have set the axis point values to the corresponding values in the graph (see attachment). If one of the bottom points is removed and newly created, the value of 0.4 in the axis point dialog is magically stripped of its fractional part resulting in 0. The same for the value of 2.5 on the right. I have traced this behavior back to the AxisPointDlg::x method within which the sscanf call converts the "0.4" string to a double valued 0 with a return value of 1 indicating a successful conversion.

1 Attachments

Discussion

  • Franz Schanovsky

    Problem solved. Was actually due to different settings of LC_NUMERIC on different machines. In general, I think it is somewhat problematic to use QString::number() for the number dialogs, as this method seems to ignore the locale settings. QLocale::toString may be a better option.

     
  • Franz Schanovsky

    Another interesting thing: the repository version of the code freezes while loading the given example file.

     
  • mark mitchell

    mark mitchell - 2016-11-21
    • status: open --> closed
     

Log in to post a comment.