First, calculate the mass (lets call it 'm') as follows:
e = 1/2 * m * v * v
In a simplified version, it is :
e= ( Bullet(grains) * Velocity(fps) * Velocity(fps) ) / 448000
That is, multiply the weight of the bullet by the velocity, and again by the velocity, then divide the WHOLE THING by 448000. It will give you the foot pounds of energy.