How to use the conseiljs.ConseilFunction.count function in conseiljs

To help you get started, we’ve selected a few conseiljs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Cryptonomic / Arronax / src / utils / render.tsx View on Github external
const formatAggregatedValue = (attribute: AttributeDefinition, value: any, aggregation: ConseilFunction) => {
      let aggregationAttribute = { ...attribute };
  
      switch (aggregation) {
          case ConseilFunction.count: 
              aggregationAttribute.dataType = AttrbuteDataType.INT;
              break;
          default:
              aggregationAttribute.dataType = attribute.dataType === AttrbuteDataType.CURRENCY ? AttrbuteDataType.CURRENCY : AttrbuteDataType.DECIMAL;
              break;
      }
  
      return formatNumber(Number(value), aggregationAttribute);
  }
github Cryptonomic / Arronax / src / components / CustomTableRow / index.tsx View on Github external
const formatAggregatedValue = (attribute: AttributeDefinition, value: any, aggregation: ConseilFunction) => {
    let aggregationAttribute = { ...attribute };

    switch (aggregation) {
        case ConseilFunction.count: 
            aggregationAttribute.dataType = AttrbuteDataType.INT;
            break;
        default:
            aggregationAttribute.dataType = attribute.dataType === AttrbuteDataType.CURRENCY ? AttrbuteDataType.CURRENCY : AttrbuteDataType.DECIMAL;
            break;
    }

    return formatNumber(Number(value), aggregationAttribute);
}