Firetron’s QuoteDecimals

2 130 Views 1 Comment 2 months ago
  • Returns the number of decimal places supported by the QuoteCurrency.

    Custom Command Dependencies:
    Firetron’s CountDecimals

    • This topic was modified 1 month, 3 weeks ago by Firetron. Reason: Added hyperlink to command
    HaasScript Code
    --  ============================================================================
    --    Firetron's QuoteDecimals
    --
    --    Returns the number of decimal places supported by the QuoteCurrency.
    --
    --    Custom Command Dependencies:
    --    Firetron's CountDecimals
    --
    --    Discord:  @FiretronP75
    --    BTC Tips: 14WLDZsrhshcP6qvBarKW8ABACv3iUXEro
    --    ETH Tips: 0xfaaac99fbf11f8f4abc4b3bf079cb2c7a43b5f87
    --  ============================================================================
    
    --  ========================================================
    --    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')
    • #1152
      Firetron
      Basic
      Up
      1
      Down

      Thank you for your help on this pshai

      • This reply was modified 1 month, 3 weeks ago by Firetron. Reason: Made hyperlink pretty
Login or Register to Comment

Unlock your crypto trading potential

Create a free account and enjoy everything we have to offer.

Join for Free