Torchlight/Enchantments

N is the number of the times that an item was enchanted

See this page Items General Info for a list of base prices based on level
 * vendor price: base_price * (1 + 0.25*N)
 * shrine price: 0


 * vendor failure rate: N*2%
 * shrine failure rate: N%

barter does not influence enchanting prices contrary to what the skill help says.