Price is always quantity (times) quality (times) market price.
For example, this game month, market price is 4.5M. If you were to purchase 15,000 missile at 250 quality the price would be:
15,000 * 2.5 * 4.5M = 168750M or 168.75B
Since the price you get from players is identical to that to the market, typically you purchase from players if you need weapons faster than waiting for market (in which case chat might be a better choice) or if you want to purchase an upgraded quality that you can not purchase from the market. For example, I have many types of ammo stored at 400 quality.