Notifications
Clear all

[Closed] Integer displayed with fix digits amount

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
(@gazybara)
Joined: 2 years ago

Posts: 0

You are looking formattedPrint fn

formattedPrint 7 format:"04d"
formattedPrint 1 format:"02d"
formattedPrint 13 format:"03d"

Quick & exact answer!

Thanks a lot gazybara, very appreciated.

  • DGN