Remove Decimal Formats from currency field

You cannot move contents from string field directly to a decimal/packed field. This is due to the currency/decimal formats present. : Ex: 1,000,000.000

Dump while string to numeric conversion

Packed / Decimal field only accepts ‘.’ as the decimal separator and number should not contain thousands separator. The only way is to remove these formats else it will throw dump stating “unable to interpret ‘xxx’ as number”.

Below code can be used to remove the decimal/currency formats.

The above code is reading user decimal format and removing the thousands formats and setting the decimal format as ‘.’ .