Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to shorten billion in javascript

const formatCash = n => {
  if (n < 1e3) return n;
  if (n >= 1e3) return +(n / 1e3).toFixed(1) + "K";
};

console.log(formatCash(2500));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #shorten #billion #javascript
ADD COMMENT
Topic
Name
8+3 =