reading csv and precision

MetLife

Active Member
Joined
Jul 2, 2012
Messages
330
Office Version
  1. 365
Hi,

I have a .csv file and it is filled with numbers between 0 and 1. There are about 15 significant digits in the file.

The issue seems to be that when I save the file (copy the values to excel then save as .csv) the .csv is truncating the digits to 10 places.

Is there anyway to keep the total number of digits? I noticed this when I tried reading the file with vba and the results were slightly off.

Thanks
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Change the number to text before saving maybe, ie insert a text character.
In your VBA remove the text character of course after reading each line.

Or change the format of the cell to text.
 
Last edited:
Upvote 0
OK thanks! It seems changing to text works.

I am using .csv files because these are universal files that are read by different software like C++ and not all can as easily read an excel file.

So since text files are more "universal", we try to use them for comparability.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top