Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
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);
}