I often have to generate a sequence of powers of ten so I created this simple utility that does it for me. It lets you generate however many powers of ten you need, starting from any value. It works in the browser and is powered by alien technology from the future.
Powers Of Ten Generator Options
Powers Of Ten Generator Examples (click to try!)
1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000, 100000000000, 1000000000000, 10000000000000, 100000000000000, 1000000000000000, 10000000000000000, 100000000000000000, 1000000000000000000, 10000000000000000000, 100000000000000000000, 1000000000000000000000, 10000000000000000000000, 100000000000000000000000, 1000000000000000000000000
1000000 (million) 100000 (one hundred thousand) 10000 (ten thousand) 1000 (thousand) 100 (hundred) 10 (ten) 1 (one) 0.1 (one tenth) 0.01 (one hundredth) 0.001 (one thousandth) 0.0001 (one ten thousandth) 0.00001 (one hundred thousandth) 0.000001 (one millionth)
64 (hundred) 3e8 (thousand) 2710 (ten thousand) 186a0 (one hundred thousand) f4240 (million) 989680 (ten million) 5f5e100 (one hundred million) 3b9aca00 (billion) 2540be400 (ten billion) 174876e800 (one hundred billion) e8d4a51000 (trillion)
How Does This Powers Of Ten Generator Work?
count values (specified in options) in the output. Each list element is calculated via the math formula
n is an integer (positive or negative). As this power series grows at an exponential rate, it uses the external
BigNumber module to work with arbitrarily large numbers. To generate the powers of ten, it first creates a BigNumber instance that's initialized to the value ten:
ten = new BigNumber(10). Then, it repeatedly calls the
ten.pow(n) function where
n is the generator loop counter. If the increasing sequence option is active, the counter
n increases by 1 in each iteration, if the decreasing sequence option is active, the counter
n decreases by 1 in each iteration. The starting counter value
n is calculated from the input value
start (specified in options). To calculate it, the tool uses another external module called
Decimal. This module exports the base 10 logarithm method
log10(start) finds the starting counter
n for the loop. Each sequence element is put in the variable
powOfTen that is then converted to the selected
base. The base conversion is done using the
toString(base) function. The resulting value is then
pushed to the
powersArray. If the Print Number Names option is active, then it also adds the number's name after the number itself. All number names are stored in the
magnitudeNames lookup array. When
count power of ten values are calculated, the loop finishes. The calculated powers are
joined together by the
separator symbol and get printed on the screen.
Created by Browserling
This powers of ten generator was created by me and my team at Browserling. Behind the scenes, it's actually powered by our web developer tools that are used by millions of people every month. Browserling itself is an online cross-browser testing service powered by alien technology. Check it out!
Secret message: If you love my tools, then I love you, too! Use coupon code TOOLLING to get a discount at my company.