I always thought that if you cancelled a building while it's being built, you got all your mineral back, but I read that the extractor trick for zerg costs 6 minerals when you cancel it.
Does this apply to all buildings/races? How is that fee calculated?