How to Format Single-Digit Numbers to Two Digits in a Microflow?

0
Hi, is there a function in Microflow that can convert a single-digit number into a two-digit? For example: 1 → 01. Thanks in advance!
asked
1 answers
1

If you're going to use leading zero, it becomes a string, not a number anymore.

So use the StringLeftPad java action from CommunityCommons.

Or build the string manually. Assuming the number can't be empty or less than 0:

(if $value >= 10 then '' else '0') + toString($value)

 

answered