Skip to content

Instantly share code, notes, and snippets.

@davalapar
Created November 29, 2019 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davalapar/870b459423248f04282c584f777eb1f8 to your computer and use it in GitHub Desktop.
Save davalapar/870b459423248f04282c584f777eb1f8 to your computer and use it in GitHub Desktop.
Constant Units
const ConstantUnits = {
Kilobyte: 2 ** 10,
Megabyte: 2 ** 20,
Gigabyte: 2 ** 30,
Second: 1000,
Minute: 60 * 1000,
Hour: 60 * 60 * 1000,
Day: 24 * 60 * 60 * 1000,
Ten: 10,
Hundred: 10 ** 2,
Thousand: 10 ** 3,
Million: 10 ** 6,
Billion: 10 ** 9,
Quadrillion: 10 **12,
Tenth: 0.1,
Hundredth: 0.1 ** 2,
Thousandth: 0.1 ** 3,
Millionth: 0.1 ** 6,
Billionth: 0.1 ** 9,
Quadrillionth: 0.1 ** 12,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment