Notifications
Clear all
[Closed] Integer displayed with fix digits amount
Feb 24, 2014 5:46 pm
I suppose this is an easy one, but since after a lot of searching I still couldn’t find the answer I thought I would ask you guys.
I am looking for a way to get an integer from 0 to 1000 to display with fix digits amount.
I thought formattedPrint should do it, but wasn’t able to configure it the right way.
Examples:
4 digits: “7” should display as —> “0007”
2 digits: “1” should display as—> “01”
3 digits: “13” should display as—> “013”
Thanks a lot!
- DGN
PS: of course I could write a fn to achieve the same result, but I would expect it to be doable in a much easier way.
2 Replies
1 Reply
You are looking formattedPrint fn
formattedPrint 7 format:"04d"
formattedPrint 1 format:"02d"
formattedPrint 13 format:"03d"