3
Views
3
Comments
Displaying Integers with Leading Zeros
Question
Is there an easy way to display an integer with leading zeros? I need to convert an integer number of minutes to h:mm format.
2016-04-22 00-29-45
Nuno Reis
 
MVP
With an if that returns 0 ou "" to prefix your number.

For a value in minutes to turn into HH:MM the formula is something like this

Mod(Minutes,60)+":"+If(Minutes-Trunc(Minutes/60)<10,"0","")+Minutes
2012-03-02 13-17-21
Paulo Ramos
Staff
Hi,

You can also use the FormatText built-in action for adding padding. Check out SS online documentation for more information.
FormatText(int, 2, 2, True, "0")
UserImage.jpg
Randy Weeton
Paulo Ramos wrote:
Hi,

You can also use the FormatText built-in action for adding padding. Check out SS online documentation for more information.
		FormatText(int, 2, 2, True, "0")
 
Thanks for the simple answer Paulo!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.