How to use the millify.default function in millify

To help you get started, we’ve selected a few millify 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 cncf / landscapeapp / src / components / ItemDialogContent.js View on Github external
function getPopupText(language) {
    const millify = require('millify').default;
    return `${language.name} ${millify(language.value, {precision: 1})}`;
  }
github cncf / landscapeapp / src / components / ItemDialogContent.js View on Github external
const headquartersElement =  itemInfo.headquarters && itemInfo.headquarters !== 'N/A' && (
    <div>
      <div>Headquarters</div>
      <div>{itemInfo.headquarters}</div>
    </div>
  );
  const amountElement = Number.isInteger(itemInfo.amount) &amp;&amp; (
    <div>
      <div>{itemInfo.amountKind === 'funding' ? 'Funding' : 'Market Cap'}</div>
      {  itemInfo.amountKind === 'funding' &amp;&amp;
          <div>
            {'$' + millify(itemInfo.amount)}
            
          </div>
      }
      { itemInfo.amountKind !== 'funding' &amp;&amp;
          <div>
            {'$' + millify(itemInfo.amount)}
            
          </div>
      }
    </div>
  );
  const tickerElement = itemInfo.ticker &amp;&amp; (
github cncf / landscapeapp / src / components / ItemDialogContent.js View on Github external
const newCallbacks =  {...callbacks, label: function(tooltipItem, data) {
    const v = data.datasets[0].data[tooltipItem.index];
    const value =  millify(v, {precision: 1});
    const language = languages[tooltipItem.index];
    return `${percents(language.value)} (${value})`;
  }};
  /*{

millify

Converts long numbers to pretty, human-readable strings

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis

Popular millify functions