src/coins/compress.js
function decompressValue(value) {
  if (value === 0)
    return 0;

  value--;

  let exp = value % 10;

  value = (value - exp) / 10;

  let n;
  if (exp < 9) {
    const last = value % 9;
    value = (value - last) / 9;
    n = value * 10 + last + 1;
  } else {
    n = value + 1;
  }

  while (exp > 0) {
    n *= 10;
    exp--;
  }

  return n;
}
function decompressValue(value) {
  if (value === 0)
    return 0;

  value--;

  let exp = value % 10;

  value = (value - exp) / 10;

  let n;
  if (exp < 9) {
    const last = value % 9;
    value = (value - last) / 9;
    n = value * 10 + last + 1;
  } else {
    n = value + 1;
  }

  while (exp > 0) {
    n *= 10;
    exp--;
  }

  return n;
}
function decompressValue ( value ) { if ( value === 0 ) return 0 ; value -- ; let exp = value % 10 ; value = ( value - exp ) / 10 ; let n ; if ( exp < 9 ) { const last = value % 9 ; value = ( value - last ) / 9 ; n = value * 10 + last + 1 ; } else { n = value + 1 ; } while ( exp > 0 ) { n *= 10 ; exp -- ; } return n ; }
Decompress value.
@param {Number} value - Compressed value.
@returns {Amount} value
Decompress value .