Skip to main content
Solved

Customer transformer converting string to integer


jackyd
Contributor
Forum|alt.badge.img+10

I am using customer transformers in a work space, but they are converting a string value to integer

The values are 002 and 003, they need to stay this way for the http calls inside the custom transformer but are getting converted to 2 and 3 (without the 00)

As read from db
After entry into the custom transformer
​​​​

Any thought on how to prevent this?

I would like to have to avoid having do something in each custom transformer to revert the values back to the strings

 

Best answer by david_r

You can use a StringFormatter inside your custom transformer if you need leading zeros, e.g. using “03s” as the format string. If you think it’s a bug, I’d recommend you create a small sample workspace to reproduce the issue and submit it at support.safe.com.

View original
Did this help you find an answer to your question?

2 replies

david_r
Evangelist
  • Best Answer
  • June 7, 2024

You can use a StringFormatter inside your custom transformer if you need leading zeros, e.g. using “03s” as the format string. If you think it’s a bug, I’d recommend you create a small sample workspace to reproduce the issue and submit it at support.safe.com.


jackyd
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • June 11, 2024

Thanks @david_r, I found the StringPadder which does the job easily and I will pop in a bug report, as it looks like unintended behaviour


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings