[gdal-dev] How to change displayed decimal places of double type in the method: OGRFeature::SetField
Chaitanya kumar CH
chaitanya.ch at gmail.com
Tue Jul 24 22:28:33 PDT 2012
DBF formats allows specifying the precision of decimal values.
Check the field definition of the .dbf file using ogrinfo. If it shows a
precision of 2, you did all you can with OGR.
Excel, on the other hand, may have different rules. There is not much that
can be done with .dbf files to control the view in Excel.
On Wed, Jul 25, 2012 at 9:56 AM, taibc <taibc_coltech at yahoo.com> wrote:
> Hi friends,
> I used the method: OGRFeature:SetField(int i, double dfValue) to set field
> values of a shapefile file (.dbf file).
> I changed dfValue format to display 2 digits in decimal places. But, when I
> used the Excel to see values, it showed an unexpected result.
> For example:
> First, dfValue = 2688.74923
> After changing format (by using code), dfValue = 2688.75
> But, when I saw values in the excel, it showed: 2688,750000000000000 (not
> How can I fix it (don't need change format settings in excel)?
> Thanks and regards,
> View this message in context:
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
Chaitanya kumar CH.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev