Tai,<br><br>DBF formats allows specifying the precision of decimal values.<br>Check the field definition of the .dbf file using ogrinfo. If it shows a precision of 2, you did all you can with OGR.<br><br>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.<br>
<br><div class="gmail_quote">On Wed, Jul 25, 2012 at 9:56 AM, taibc <span dir="ltr"><<a href="mailto:taibc_coltech@yahoo.com" target="_blank">taibc_coltech@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi friends,<br>
<br>
I used the method: OGRFeature:SetField(int i, double dfValue) to set field<br>
values of a shapefile file (.dbf file).<br>
<br>
I changed dfValue format to display 2 digits in decimal places. But, when I<br>
used the Excel to see values, it showed an unexpected result.<br>
<br>
For example:<br>
First, dfValue = 2688.74923<br>
After changing format (by using code), dfValue = 2688.75<br>
<br>
But, when I saw values in the excel, it showed: 2688,750000000000000 (not<br>
2688.75)<br>
<br>
How can I fix it (don't need change format settings in excel)?<br>
<br>
Thanks and regards,<br>
Tai<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/How-to-change-displayed-decimal-places-of-double-type-in-the-method-OGRFeature-SetField-tp4990648.html" target="_blank">http://osgeo-org.1560.n6.nabble.com/How-to-change-displayed-decimal-places-of-double-type-in-the-method-OGRFeature-SetField-tp4990648.html</a><br>
Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br><br>+91-9494447584<br>17.2416N 80.1426E<br>