I have a typical long narrow battery with a more or less v-shaped profile. It rattled on an otherwise whisper quiet (belt driven internal hub gears - wuss bike). The problem has been solved very effectively (so far) with two tiny (smallest available) stick on rubber cupboard door rubber things...