docs: function formatXrbValue (xrbValue,
    {
      commas,
      decimals,
      decimalPlaces,
      unit
    }) {
    let unitPlaces = units[unit].places
    let fractionalPartOfXrbValue = xrbValue.substring(xrbValue.length - unitPlaces)  
    let integerPartOfXrbValue = xrbValue.substring(0, xrbValue.length - fractionalPartOfXrbValue.length)
    let integerPartOfXrbValueWithCommas = []
  
    if (commas) {
      let commasInsertTrigger = 0 // when equal to 3 then this is the trigger to insert a comma
  
      for (let i = integerPartOfXrbValue.length - 1; i >= 0; i--) {
        // Comma insert has been triggered and we are not at the beginning of the integer part
        if (commasInsertTrigger === 3 && i >= 0) {
          integerPartOfXrbValueWithCommas.unshift(',')
          commasInsertTrigger = 0
        }
  
        integerPartOfXrbValueWithCommas.unshift(integerPartOfXrbValue[i])
        commasInsertTrigger++
      }
  
      integerPartOfXrbValue = integerPartOfXrbValueWithCommas.join('')
    }
  
    if (unit === UNIT_RAW) {
      return integerPartOfXrbValue
    } else {
      if (decimals) {
        return integerPartOfXrbValue + '.' + (decimalPlaces === 0 ? fractionalPartOfXrbValue : fractionalPartOfXrbValue.substring(0, decimalPlaces))
      } else {
        return integerPartOfXrbValue
      }
    }
  }