Do you have Finance_Savings__c checked off in the right-hand-side tree in Script Editor?
$math.sub( $total.length(), 3 )
instead of the more fragile minus sign operator.
Also, what are you trying to do with the substring()? You just want the number without decimal points?
I don't really understand your response -- this is solved now, though?
Anyway, if you want the variable to be comma-thousands-delimited but not have a decimal point, you don't want number.currency(). By definition, Currency has two digits after the decimal point, which you just end up stripping off. You just need the one line:
number.format() adds the commas (in the US locale, which I can see you're in) but not the decimal points.
Thank you for your assistance. What my snippet revealed was I needed to checkmark the field at the program/folder level in all my workspaces. I didn't realize when the scripting token is created it only applies to that program/folder and I would have to remark the finance savings token. As far as the script, what I have is working. Not sure what happened when I tried replacing out with your code suggestions, the code broke. Thanks again for all your help.
Yes, a Velocity token is 2 things: code and context. If you use the same code without exporting necessary objects/fields into its context it won't work. (Or, more accurately, it's *unlikely* to work: it would still function if *another* token in the same email had exported the object.)