Problem with Uploading Data (Extra Decimal Points for Percentages)

I import this csv:
0,0.0%,100.0%,100.0%,100.0%,100.0%,100.0%,100.0%
1,5.0%,50.9%,17.2%,51.9%,83.4%,76.3%,19.6%
2,10.0%,47.8%,13.8%,46.0%,83.4%,73.8%,15.7%
3,15.0%,44.4%,13.8%,37.7%,82.3%,67.4%,15.2%
4,20.0%,42.5%,13.8%,35.9%,80.5%,61.9%,15.1%
5,25.0%,38.9%,13.8%,32.1%,76.7%,52.5%,15.0%
6,30.0%,27.4%,3.4%,20.2%,65.9%,38.6%,4.6%
7,35.0%,22.4%,0.0%,17.4%,61.9%,28.1%,0.5%
8,40.0%,19.7%,0.0%,15.9%,57.2%,21.3%,0.5%
9,45.0%,16.6%,0.0%,13.4%,50.7%,15.4%,0.5%
10,50.0%,15.3%,0.0%,12.8%,47.1%,13.3%,0.1%
11,55.0%,13.8%,0.0%,11.9%,42.9%,11.5%,0.1%
12,60.0%,11.2%,0.0%,10.7%,34.4%,8.6%,0.1%
13,65.0%,9.7%,0.0%,10.1%,29.8%,6.6%,0.1%
14,70.0%,7.6%,0.0%,9.0%,23.2%,4.0%,0.1%
15,75.0%,6.8%,0.0%,8.2%,21.0%,3.2%,0.0%
16,80.0%,5.2%,0.0%,7.5%,15.7%,1.8%,0.0%
17,85.0%,4.3%,0.0%,6.9%,12.3%,1.4%,0.0%
18,90.0%,2.3%,0.0%,3.6%,6.8%,0.5%,0.0%
19,95.0%,1.2%,0.0%,1.5%,4.0%,0.2%,0.0%
20,100.0%,0.5%,0.0%,0.6%,2.0%,0.0%,0.0%

It only has percentages with 1 decimal point. However, when Coda imports the data it has lots of decimals:

This is annoying because I don’t want to manually go through and select the number of decimal places for each column because I have to upload many of these csvs and because Coda doesn’t have a way to edit multiple column formats at once:
image

I intentionally formatted it this way for easy upload. Why isn’t it doing what I expect?

1 Like

Known issue, Coda is using IEEE 754 for floating point math. This is pretty much the standard for all programming platforms and is native for processors. The problem is that only decimal parts that are 1/2, 1/4, 1/8, 1/16 etc (half of the previous one) or their sums (e.g. 0.75 as it’s 1/2 + 1/4) can be accurately represented in this encoding, while for 0.8 there’s no way to accurately store it as a sum of these fractions, hence these …000000002%.

The solution would be implementing some sort of decimal or fractional math, but it’s not an easy change, I believe.

The other thing is that if you need so many columns with percentages, perhaps you’re modelling your data wrong and not in the spirit of Coda? It might have made more sense to have these columns stored as separate rows?

1 Like