If it reads in metres per second as most of the cheapie Chinese ones do, the formula is:

velocity x velocity x weight x 10.76 / 450240

for feet per second its:

velocity x velocity x weight / 450240

In both of those the pellet weight is in grains, to convert to grains from grams it's:

1 gram = 15.4324 grains

If you find that your scales don't give sufficient resolution then weigh 10 or 100 pellets at once and divide the reported weight appropriately to get the weight of one pellet.