Bug 261884 - When importing a file .pov with ", " as decimal separator all the digits are truncated at the integer part.
Summary: When importing a file .pov with ", " as decimal separator all the digits are ...
Status: RESOLVED FIXED
Alias: None
Product: kpovmodeler
Classification: Miscellaneous
Component: general (show other bugs)
Version: CVS
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: Andreas Zehender
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-02 18:21 UTC by Marco Bobba
Modified: 2011-01-08 19:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Set LC_NUMERIC to POSIX during the conversion (1.04 KB, patch)
2011-01-02 18:22 UTC, Marco Bobba
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Bobba 2011-01-02 18:21:01 UTC
Version:           CVS (using KDE 4.4.5) 
OS:                Linux

atof convert ascii to float using the locale setting but povray need "." as decimal separator. In system where the decimal separator is "," the value are truncated at the integer part.
This patch seem work ...

Reproducible: Always

Steps to Reproduce:
Set a locale with "," as decimal separator and  import a file .pov with float values

Actual Results:  
Integer truncated

Expected Results:  
float
Comment 1 Marco Bobba 2011-01-02 18:22:18 UTC
Created attachment 55476 [details]
Set LC_NUMERIC to POSIX during the conversion
Comment 2 Christoph Feck 2011-01-03 02:07:34 UTC
Right, and this was the issue you fixed in your original patch by replacing atof with a Qt function. I think replacing it is a better fix. Will recheck your old patch in the coming days.
Comment 3 Christoph Feck 2011-01-08 19:05:59 UTC
SVN commit 1212937 by cfeck:

Parse floats in C locale

Use QByteArray::toDouble() instead of atof(). The Qt function
is documented to always use the C locale (which has "." as the
decimal separator), instead of the current locale.

BUG: 261884


 M  +2 -2      pmscanner.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1212937