I noticed that when upgrading my Blacksmith, I went into negative numbers with coal. After a restart which didn't save my progress, I clicked repeatedly to find out at what point it allows me to buy the upgrade. The price was 4.9k Coal and when it let me buy it, I was left with -0.674k Coal. No idea if this always happens at around 14% under the selling price. Probably be easier for you to figure that one out.