I'm quite new to Velocity templates, and try to get a phone number of 8 digits displayed like "12 34 56 78" or "123 45 678".
I've tried a lot of variations, including
- $number.format('00 00 00 00',${phone})
- $number.format('#0 00 00 00',$phone)
- $display.printf("%s %s %s %s", $phone.substring(0,2), $phone.substring(2,4), $phone.substring(4,6), $phone.substring(6,8))
Where $number = new NumberTool() and $display = new DisplayTool()
The two first outputs the number without spaces, while the last one is not parsed by Velocity.