EDIT: Power is proportional to voltage/current squared for all linear circuits. In AC circuit analysis, voltage, current, and power all become phasors. In nonlinear circuits, power may not be proportional to voltage/current squared, but the convention is still used for decibels. It even holds in an abstract field like signal processing, where the "power" of a signal is defined to be the average of the amplitude squared.
Decibels are used to give the magnitude of the gain. If you want to talk about power loss, you use negative decibels, which represents a fractional gain. For example:
You can also have an actual negative gain, like what you get from an inverting amplifier. The negative there is described as a phase shift. To fully describe an amplifier, you usually need both the magnitude and the phase of the gain. (This might be a bit advanced for you, but you could try looking up Bode Plots to see how this is used in real life.) Anyway, here's how to describe an inverting amplifier with a voltage gain of -2.4:
The term "negative gain" is reserved for those cases where the line has a downward slope and so reverses the polarity of the signal (a 180° phase change). A op-amp in an inverting configuration is a prime example.
What you have is an attenuating amplifier; the signal out has a somewhat decreased amplitude from the signal coming in but not a different sign. (I'm ignoring the offset of the sloped line in order to keep it simple)
The relation of the voltage-over-voltage gain (V/V) to dB gain often confuses people since the dB measurement actually strips out the "inverting" property of negative-gain amplifiers (since you take the log of the absolute value of the gain). Let's set up fours scenarios for different line slopes (V/V gain):
Gain: 2 V/V or 20*log(|2|) = 6 dB and 0° phase difference
Gain: 0.5 V/V or 20*log(|0.5|) = -6 dB and 0° phase difference
Gain: -0.5 V/V or 20*log(|-0.5|) = -6 dB and 180° phase difference
Gain: -2 V/V or 20*log(|-2|) = 6 dB and 180° phase difference
Scenarios 1 and 2 have a positive slope/gain and thereby a 0° phase difference while scenarios 3 and 4 have negative gain (signal inverting) and thereby a 180° phase difference. Scenarios 2 and 3 have a gain who's absolute value is less than one and thereby are attenuating amplifiers, expressed by a negative dB gain, while scenarios 1 and 4 are "amplifying amplifiers".
The purpose of an amplifier isn't always to increase the voltage amplitude of a signal being passed through. It might for example be used to drive a current-hungry device when the source signal/device can't, like loudspeaker power amplifiers do.
I wouldn't call this the "voltage gain in decibels." I'd rather say it's the decibel gain, calculated from the voltage gain.
Sometimes, you will see a voltage gain expressed in decibel according to this formula even when the input and output impedances are different. There is no technical justification for this --- it's simply a shorthand practice that's become common through usage.
Best Answer
$$\begin{align} A_{v,dB} &= 10\cdot\log \frac{V_o^2}{V_i^2} \\ &= 10\cdot\log \left(\frac{V_o}{V_i}\right)^2 \\ &= 10\cdot 2 \cdot\log \frac{V_o}{V_i} \end{align} $$
EDIT: Power is proportional to voltage/current squared for all linear circuits. In AC circuit analysis, voltage, current, and power all become phasors. In nonlinear circuits, power may not be proportional to voltage/current squared, but the convention is still used for decibels. It even holds in an abstract field like signal processing, where the "power" of a signal is defined to be the average of the amplitude squared.
$$A_p = 0.01$$ $$A_{p,dB} = 10\cdot\log 0.01 = -20\:\mathrm{dB}$$
You can also have an actual negative gain, like what you get from an inverting amplifier. The negative there is described as a phase shift. To fully describe an amplifier, you usually need both the magnitude and the phase of the gain. (This might be a bit advanced for you, but you could try looking up Bode Plots to see how this is used in real life.) Anyway, here's how to describe an inverting amplifier with a voltage gain of -2.4:
$$A_v = -2.4$$ $$|A_v| = 20\cdot\log 2.4 \approx 7.6\:\mathrm{dB}$$ $$\angle A_v = 180^\circ$$