Median / Centiles for "histogram data"

I have data in the following format:

shares | users
0 | 929000
1 | 321000
2 | 104520

The first line represents 929,000 users performing 0 actions and the next line represents 321,000 users performing 1 action.

How can I calculate the median and percentiles for this data? Better yet, if there is a way to convert this data into something for which I can easily use all the normal functions to calculate the average, the cdf, and so on.