
If you want to keep things simple just give the players the value and when they go sell them that's what they get. I like to add a little texture to this aspect of the game. When I see or list a value of a gem I will roll to determine how close a player can estimate its value, whether they are estimating to high or low. Other factors I consider is the need for that gem in the shop, the honesty of the shop keeper and whether the gem is in fashion that season (those nobles get snooty about fashion trends).
To determine how close a player can estimate the value of a gem or piece of jewelry I roll a d20, usually set the difficulty task at 15 for average gems and add any intelligence modifiers. If the player fails on an even number the player over estimates the value of the gem and a failure on an odd number the player will guess the value to be lower. Anything over a 15 I tell them the listed value. Larger or rare gems the task level is set at 18.
The need in a gem shop is often determined by what is in fashion that season. If emeralds are in fashion the gem merchant will purchase as many of those as possible and may pay a higher price. But should the players try to sell these same emeralds during the next season when the fashion trends have moved onto rubies, the shop will be reluctant to buy emeralds, or offer a low price. The fashion trends change every three to six months.
The honesty of the shop keeper is usually determined on how he is written, but if the players are rude or try to intimidate the shopkeeper will refuse to pay top price or refuse to purchase any gems from them all. And if you really want to keep your players on their toes, my gem merchants belong to a guild so if you piss off one of them good luck finding a place to sell them. The players will be rebuffed or offered insulting low prices.
The players can always try the black market. First they will need a contact and depending on their reputation they will get thirty to forty percent of the value. Once the players are established with the black market they may be offered up to fifty to sixty percent.
I use this same system for jewelry and mundane brick-a-brack. I like it because it adds a little texture to the game besides just dumping the gems off and collecting the coins. The good thing about using this kind of system is it allows the players to develop a relationship with the shopkeeper (good or bad) and more adventures can start from there.