Firetron's QuoteDecimals

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

Description

Returns the number of decimal places supported by the QuoteCurrency. Custom Command Dependencies: Firetron’s CountDecimals
HaasScript
--  ============================================================================
--    Firetron's QuoteDecimals
--
--    Returns the number of decimal places supported by the QuoteCurrency.
--
--    Custom Command Dependencies:
--    Firetron's CountDecimals
--
--    Discord:  @FiretronP75
--  ============================================================================

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

DefineCommand('QuoteDecimals', 'Returns the number of decimal places supported by the QuoteCurrency.')

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

local market = DefineParameter(StringType, 'market', 'The market.', false, PriceMarket(), 'InputAccountMarket, InputMarket, PriceMarket')

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

local truncated = ParseTradePrice(market, 1111.111111111111)
local output    = CC_CountDecimals(truncated)

DefineOutput(NumberType, output, 'the number of decimal places supported by the QuoteCurrency')

1 Comment

Sign in to leave a comment.

F
Firetron almost 6 years ago

Thank you for your help on this pshai