How to Format Integer with Leading Zeros
Hello,
I'm trying to format an integer value as a fixed-length string with leading zeros (e.g., converting 345 into "000345"
) within a Data Transform in Pega Infinity 24.2.2.
I’ve tried the following approaches:
-
@String.format("%06d", .NextSeq)
→ This gives the error:Invalid expression or reference: No candidates found
. -
@sprintf("%06d", .NextSeq)
→ Also not recognized — throws the same error. -
@pxNumber.FormatInt(.NextSeq, 6)
→ This seemed promising but isn't recognized either in the DT expression context.
What’s the correct way (if any) to apply C-style format tokens like %06d
or achieve the same result in a Data Transform, without using an Activity?
Thanks in advance!