Since you are asking in the Just-dice thread I assume that you mean the staking formula for Just-Dice as a staking pool.
First to stake your clams at Just-Dice you need to invest your Clams in Just-Dice's bankroll, having your coins on play balance doesn't give stakes (in this case share of stakes), you receive stakes in proportion of the percentage that you provide to the Just-Dice bankroll.
Let's suppose that you have an amount of clams equivalent to 0.0001% of Just-Dice bankroll, every time that Just-Dice stake a block that is 1 clam per block you get 0.0001% of the amount staked. Also you get deducted 10% of your stake share as a Just-Dice fee, as far I know the fee is payed at the moment that you receive the stake (instantaneously ), I mean is not subject to be paid on withdrawal or after the end of commission circle.
Is good to clarified that since Just-Dice provide a feature that permit you to add leverage to your investment or declare offsite coins, the only balance that is counted as investement for staking purposes is the invested onsite you can find that on the stats tab, beside the chat tab.
Note: I tried to get a proof of this with my balance and a calculator but didn't got the same results maybe I'm missing something or using the calculator wrong (like most of the time) so better wait to someone else with better maths to confirm if it is like i wrote it.