Firetron’s FormatRoundedPercent

1 850 Views No Comments 3 years ago
  • Formats a number to be rounded and have the percent symbol.

    Custom Command Dependencies:
    None

    Test code:

    if not Load('done', false) then
    
      local closes = ClosePrices()
      local close1 = ArrayGet(closes, 1)
      local close2 = ArrayGet(closes, 2)
    
      local change = PercentageChange(close1, close2)
    
      Log(' ')
      Log(change)
      Log('Chnage:')
      Log(' ')
    
      local formatted = CC_FormatRoundedPercent(change)
    
      Log(formatted)
      Log('Formatted Default:')
      Log(' ')
    
      local formatted2 = CC_FormatRoundedPercent(change, 4, ' @')
    
      Log(formatted2)
      Log('Formatted Another Way:')
      Log(' ')
    
      Save('done', true)
    
    end
    • This topic was modified 2 years, 6 months ago by Team HaasScripts.
    • This topic was modified 2 years ago by Firetron. Reason: Removed tip addresses
    • This topic was modified 1 year, 8 months ago by Firetron. Reason: Updated to latest standards
    HaasScript Code
    Sign in or Register to download for free
  • Mandala Trading Competition Promotion Type: contest Expires: June 9, 2023 Exclusive
    Trading volume competition, win up to $10,000 USDT and bounties.
  • Earn Up to 200 BMEX Tokens Promotion Type: contest Expires: March 31, 2023
    15 BMEX @ $20,000, 25 BMEX @ $50,000, 50 [email protected] $200,000, 100 BMEX @ $400,000, 200 BMEX @ $600,000 in monthly derivatives volume
Login or Register to Comment

Unlock your crypto trading potential

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

Join for Free