How to use the numeral.zeroFormat function in numeral

To help you get started, we’ve selected a few numeral examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Graylog2 / graylog2-server / graylog2-web-interface / src / components / inputs / InputIOMetrics.jsx View on Github external
_renderNetworkMetrics(nodeState) {
    if (nodeState === null) {
      return null;
    }

    // ugh, is there a way of not doing it globally?
    numeral.zeroFormat('0B');

    var network = (
      <span>
        <span>Network IO: </span>
        <span>
          <i>
          <span>{numeral(nodeState.read_bytes_1sec).format("0.0b")} </span>

          <i>
          <span>{numeral(nodeState.written_bytes_1sec).format("0.0b")}</span>
        </i></i></span><i><i>

        <span>
          <span> (total: </span>
          <i>
          <span>{numeral(nodeState.read_bytes_total).format("0.0b")} </span></i></span></i></i></span>
github Graylog2 / graylog2-server / javascript / src / components / inputs / InputIOMetrics.jsx View on Github external
_renderNetworkMetrics(nodeState) {
        if (nodeState === null) {
            return null;
        }

        // ugh, is there a way of not doing it globally?
        numeral.zeroFormat('0B');

        var network = (
            <span>
                    <span>Network IO: </span>
                    <span>
                        <i></i>
                        <span>{numeral(nodeState.read_bytes_1sec).format("0.0b")} </span>

                        <i></i>
                        <span>{numeral(nodeState.written_bytes_1sec).format("0.0b")}</span>
                    </span>

                    <span>
                        <span> (total: </span>
                        <i></i>
                        <span>{numeral(nodeState.read_bytes_total).format("0.0b")} </span></span></span>
github Graylog2 / graylog2-server / javascript / src / components / inputs / InputIOMetrics.jsx View on Github external
<span>{numeral(nodeState.written_bytes_1sec).format("0.0b")}</span>
                    

                    <span>
                        <span> (total: </span>
                        <i></i>
                        <span>{numeral(nodeState.read_bytes_total).format("0.0b")} </span>

                        <i></i>
                        <span>{numeral(nodeState.written_bytes_total).format("0.0b")}</span>
                        <span> )</span>
                    </span>
                
        );
        // wow this sucks
        numeral.zeroFormat(null);

        return network;
    },
github Graylog2 / graylog2-server / graylog2-web-interface / src / components / inputs / InputIOMetrics.jsx View on Github external
<span>{numeral(nodeState.written_bytes_1sec).format("0.0b")}</span>
        

        <span>
          <span> (total: </span>
          <i>
          <span>{numeral(nodeState.read_bytes_total).format("0.0b")} </span>

          <i>
          <span>{numeral(nodeState.written_bytes_total).format("0.0b")}</span>
          <span> )</span>
        </i></i></span><i><i>
      
    );
    // wow this sucks
    numeral.zeroFormat(null);

    return network;
  },
</i></i>
github Graylog2 / graylog2-server / graylog2-web-interface / src / util / NumberUtils.js View on Github external
formatBytes(number) {
    numeral.zeroFormat('0B');

    let formattedNumber;
    try {
      formattedNumber = numeral(this.normalizeNumber(number)).format('0.0ib');
    } catch (e) {
      formattedNumber = number;
    }

    numeral.zeroFormat(null);

    return formattedNumber;
  },
  isNumber(possibleNumber) {
github Graylog2 / graylog2-server / graylog2-web-interface / src / util / NumberUtils.js View on Github external
formatBytes(number) {
    numeral.zeroFormat('0B');

    let formattedNumber;
    try {
      formattedNumber = numeral(this.normalizeNumber(number)).format('0.0ib');
    } catch (e) {
      formattedNumber = number;
    }

    numeral.zeroFormat(null);

    return formattedNumber;
  },
  isNumber(possibleNumber) {