Truncate Number Fields When Converting Strings to Numbers

About this task

By default, the translator trims all trailing zeros from output values. For example, 80000.0100 will be output as 8000.01. This behavior is not desirable for financial standards such as SWIFT, for which trailing zeros represent a specific amount for a particular currency.

Therefore, the storage.keepTrailingZeros property in the translator.properties file enables you to specify whether or not trailing zeros are kept on any numeric field on the output side of the map (numeric fields that have been converted to strings).

By default trailing zeros are trimmed (storage.keepTrailingZeros=false). If you set this property to True, this will preserve trailing zeroes. Therefore, by default the value 3.142000 is truncated to 3.142, but if you set the storage.keepTrailingZeros property to True, the resulting string value is 3.142000.

To set the storage.keepTrailingZeros property to True:

Procedure

  1. In the install_dir/properties directory, locate (or create, if necessary) the customer_overrides.properties file.
  2. Open the customer_overrides.properties file in a text editor.
  3. Add the property that you want to override, using the following format:
    
    translator.storage.keepTrailingZeros=True
    
  4. Save and close the customer_overrides.properties file.
  5. Restart the Sterling B2B Integrator to use the new values.