ethereum/mist

View on GitHub
interface/utils/formatters.js

Summary

Maintainability
A
0 mins
Test Coverage
export function formatTokenCount(value, decimals) {
  return Number((value /= Math.pow(10, decimals))).toString();
}

export function formatFunctionName(functionName) {
  if (functionName === undefined)
    throw new Error('formatFunctionName() expects a non-empty string');
  return functionName
    .slice(0, functionName.indexOf('('))
    .replace(/_+/g, ' ')
    .replace(/([A-Z]+|[0-9]+)/g, ' $1')
    .toLowerCase()
    .trim();
}