ui/app/util.js
// Takes  hex, returns [beforeDecimal, afterDecimal]
Takes  hex, returns [beforeDecimal, afterDecimal]
Takes hex returns [ beforeDecimal afterDecimal ]
function parseBalance (balance) {
  var beforeDecimal, afterDecimal
  const wei = numericBalance(balance)
  var weiString = wei.toString()
  const trailingZeros = /0+$/
  beforeDecimal = weiString.length > 18 ? weiString.slice(0, weiString.length - 18) : '0'
  afterDecimal = ('000000000000000000' + wei).slice(-18).replace(trailingZeros, '')
  if (afterDecimal === '') { afterDecimal = '0' }
  return [beforeDecimal, afterDecimal]
}
function parseBalance ( balance ) { var beforeDecimal , afterDecimal const wei = numericBalance ( balance ) var weiString = wei . toString ( ) const trailingZeros = / 0+$ / beforeDecimal = weiString . length > 18 ? weiString . slice ( 0 , weiString . length - 18 ) : '0' afterDecimal = ( '000000000000000000' + wei ) . slice ( - 18 ) . replace ( trailingZeros , '' ) if ( afterDecimal === '' ) { afterDecimal = '0' } return [ beforeDecimal , afterDecimal ] }
Takes  hex, returns [beforeDecimal, afterDecimal]
Takes hex returns [ beforeDecimal afterDecimal ]