Used to format a given number into a short representation.
<p/>
Examples:
Given 9100, will return "9.1k".
Given 8100000, will return "8.1m"
Given 10, will return 10"

@param count Value to convert.
@return Formatted value (see examples)
192072
public static String getFormattedCount(Long count) {
        final String unit;
        final Double dbl;
        final DecimalFormat format = new DecimalFormat("#.#");
        if (count < 1000) {
            return format.format(count);
        } else if (count < 1000000) {
            unit = "k";
            dbl = count / 1000.0;
        } else if (count < 1000000000) {
            unit = "m";
            dbl = count / 1000000.0;
        } else {
            unit = "b";
            dbl = count / 1000000000.0;
        }
        return format.format(dbl) + unit;
    }
1181228
public static String format(final double num) {
		final NumberFormat dFormatter = new DecimalFormat("#0.00");
		final String sFformatter = dFormatter.format(num);
		return format(sFformatter + "");
	}
375491
public int count(T x, T y, int count) {
        if (count < 1)
            throw new IllegalArgumentException("Count must be positive: " + count);
        long index = getIndex(x, y);
        int oldCount = counts.get(index);
        int newCount = count + oldCount;
        counts.put(index, newCount);
        sum += count;
        return newCount;
    }
503246
public static String formatNumber(int num) {
        DecimalFormat format = new DecimalFormat();
        format.setDecimalSeparatorAlwaysShown(false);
        return format.format(num);
    }
1119869
public void setCount(int count)
    {
        if (count < 0 || 0xFF < count)
        {
            throw new IllegalArgumentException("'count' is out of the valid range: " + count);
        }

        mCount = count;

        getData()[COUNT_INDEX] = (byte)count;
    }
519463
def num(self, count=None, show=None):  # (;$count,$show)
        
        if count is not None:
            try:
                self.persistent_count = int(count)
            except ValueError:
                raise BadNumValueError
            if (show is None) or show:
                return str(count)
        else:
            self.persistent_count = None
        return ""
795106
public function checkDigits($value, $count)
    {

        if (is_numeric($value)) {
            $value = "$value";
        }

        if (!Type::isStringLike($value)) {
            return false;
        }

        return ! preg_match('/[^0-9]/', "$value")
            && strlen("$value") == $count;
    }
1291728
public final String format(long number) {
        StringBuffer buf = new StringBuffer(19);
        FieldPosition pos = new FieldPosition(0);
        format(number, buf, pos);
        return buf.toString();
    }
662095
public static byte[] nextBytes(final int count) {
        Validate.isTrue(count >= 0, "Count cannot be negative.");

        final byte[] result = new byte[count];
        RANDOM.nextBytes(result);
        return result;
    }
1108263
public static DoubleStream buildRandomNumberStream(int count) {
        return IntStream.range(0, count).mapToDouble(i -> Math.random());
    }
1172740
public static String repeat(char c, int count) {
      StringBuilder builder = new StringBuilder();
      for (int i = 0; i < count; i++) {
         builder.append(c);
      }
      return builder.toString();
   }
616766
public ScanParams count(final Integer count) {
    params.put(COUNT, ByteBuffer.wrap(Protocol.toByteArray(count)));
    return this;
  }
745302
public <N extends Number> CellFormatResult format(final String formatPattern, final N value) {
        return format(formatPattern, value, Locale.getDefault());
    }
216825
static Predicate<DateValue> countCondition(final int count) {
        return new Predicate<DateValue>() {
            int count_ = count;

            public boolean apply(DateValue value) {
                return --count_ >= 0;
            }

            @Override
            public String toString() {
                return "CountCondition:" + count_;
            }
        };
    }
585493
public static String formatPluralCurrency(final Number value)
    {
        DecimalFormat decf = context.get().getPluralCurrencyFormat();
        return stripZeros(decf, decf.format(value));
    }
290105
public static String formatNumber(Number value, String mask, double round) {
        double val = 0;
        if (value != null) {
            val = value.doubleValue();
        }
        return formatNumber(val, mask, round);
    }
161729
public static Format getNumberFormatter(final String pattern) {
		Format format = JKFormatUtil.formatMap.get(pattern);
		if (format == null) {
			format = new DecimalFormat(pattern);
			JKFormatUtil.formatMap.put(pattern, format);
		}
		return format;
	}