Well, apart from the ".X." left over from the earlier thing you showed, and some subtraction from 10,000 to get the xxxx value, you should be about there.
Delete the ",X". Subtract that final value from 10,000, which will give you the remaining length of the record after the field whose sum you want. Replace the xxxx with the result of your calculation. Try it out.