Skip to content

Instantly share code, notes, and snippets.

@edazpotato
edazpotato / abbreviate-number.js
Created December 30, 2020 22:35 — forked from tobyjsullivan/abbreviateNum.js
Abbreviate large numbers in Javascript (as a es6 module)
export default function abbreviateNumber(value) {
let newValue = value;
const suffixes = ["", "K", "M", "B","T"];
let suffixNum = 0;
while (newValue >= 1000) {
newValue /= 1000;
suffixNum++;
}
newValue = newValue.toPrecision(3);
@edazpotato
edazpotato / v-cloak.css
Last active September 22, 2020 01:19 — forked from oze4/v-cloak.css
v-cloak for vue.js loading
[v-cloak] {
visibility: hidden;
display: block;
padding: 50px 0;
}
@keyframes spinner {
to {
transform: rotate(360deg);
}