Percentages are basically some ratio times 100%. So if your ratio is say 1/10 = 0.1 then the percentage is 1/10 * 100% = 0.1 * 100% = 10%.
With regards to the dilution you calculate 15/40 = 3/8 just as you have done so yourself. Remember its just a ratio of one thing relative to another (in this case, concentrate relative to water).
To convert that to a percentage we multiply that ratio by 100% which gives us 3/8 *100 = 300/8 = 75/2 = 32.5%