Firetron's FormatRoundedProfitCurrency

stable
By Firetron in Miscellaneous Published August 2020 👁 1,544 views 💬 0 comments

Description

Formats a number to be rounded and have the profit currency symbol.
HaasScript
--  ============================================================================
--    Firetron's FormatRoundedProfitCurrency
--
--    Formats a number to be rounded and have the profit currency symbol.
--
--    Discord:  @FiretronP75
--  ============================================================================

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

DefineCommand('FormatRoundedProfitCurrency', 'Formats a number to be rounded and have the profit currency symbol.')

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

local input  = DefineParameter(NumberType, 'Input',  'The number to format',   true,  0)
local market = DefineParameter(StringType, 'market', 'The currency market',    false, PriceMarket(), 'InputAccountMarket, InputMarket, PriceMarket')
local digits = DefineParameter(NumberType, 'Digits', 'The digits to round to', false, 10)
local symbol = DefineParameter(StringType, 'Symbol', 'The symbol to append',   false, ' '..ProfitLabel(market))

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

DefineOutput(StringType, Round(input, digits)..symbol, 'Formatted Value')

0 Comments

Sign in to leave a comment.

No comments yet. Be the first!