Best way to sanitize a decimal field (remove commas and $'s)

String#tr and tr!, assuming that nobody enters EUropean format
numbers,

http://www.ruby-doc.org/core/classes/String.html#M000845

When I use a comma or dollar sign, however, it sets my value to zero:

"1,000".tr(',', '') #=> "0"
"$1000".tr('$', '') #=> "0"
"$1,000".tr('$,', '') #=> "0"

Is this proper use of tr?

If you want to 'translate' to "", delete is more specific.

>> "1,000,000".delete ","
=> "1000000"

When I use a comma or dollar sign, however, it sets my value to zero:

"1,000".tr(',', '') #=> "0"
"$1000".tr('$', '') #=> "0"
"$1,000".tr('$,', '') #=> "0"

Is this proper use of tr?

To follow up, you can delete both at once:

>> "$2,345".delete "$,"
=> "2345"

By the way, pasting in your first your example above I get this:

"1,000".tr(',', '')
=> "1000"