How are earnings calculated?

How are earnings calculated?