Firetron's FormatTwoDigit

stable
By Firetron in Miscellaneous Published July 2020 👁 1,217 views 💬 0 comments

Description

Formats a number to have two digits like 04.
HaasScript
--  ==========================================================================================================
--    Firetron's FormatTwoDigit
--
--    Formats a number to have two digits like 04.
--
--    Discord:  @FiretronP75
--  ==========================================================================================================

--  ==============
--    Definition
--  ==============

DefineCommand('FormatTwoDigit', 'Formats a number to have two digits like 04.')

--  ==============
--    Parameters
--  ==============

local input = DefineParameter(NumberType, 'Input', 'The number to format', true, 0)

--  ==========
--    Output
--  ==========

local output = ''..input

if input < 10 then
  output = '0'..input
end

DefineOutput(StringType, output, 'Formatted Value')

0 Comments

Sign in to leave a comment.

No comments yet. Be the first!