Convert exponential notation of number (e+) to 10^ in JavaScript

I have a script, where I can convert gigs to megs to kilobytes to bytes to bits.

After that it uses the .toExponential function to turn it into scientific notation.

But I want it to change into an exponent, instead of it being +e# I want it to be ^#, any way I can change it to print that way instead, if not, anyway I can alter the string to change +e to ^?


const gigabytes = 192;
console.log(`gigabytes equals ${gigabytes}`);
var megabytes = gigabytes * 1000;
console.log(`megabytes = ${megabytes}`);
var kilabytes = megabytes * 1000;
console.log (`kilabytes = ${kilabytes}`);
bytes = kilabytes * 1000;
console.log(`bytes = ${bytes}`);
bites = bytes * 8;
console.log(`bites are equal to ${bites}`);
console.log (bites.toExponential());

189 thoughts on “Convert exponential notation of number (e+) to 10^ in JavaScript”

  1. What i do not realize is in reality how you are no longer really a lot more smartly-favored than you may be right now. You are very intelligent. You recognize therefore significantly relating to this subject, produced me in my view consider it from numerous numerous angles. Its like men and women don’t seem to be interested unless it’s something to accomplish with Girl gaga! Your personal stuffs excellent. At all times care for it up!

  2. Thank you for sharing excellent informations. Your web site is so cool. I’m impressed by the details that you¦ve on this blog. It reveals how nicely you perceive this subject. Bookmarked this website page, will come back for extra articles. You, my friend, ROCK! I found just the info I already searched everywhere and simply could not come across. What an ideal web-site.

  3. certainly like your website but you have to test the spelling on quite a few of your posts.
    A number of them are rife with spelling issues and I find it very troublesome to tell the reality however I will certainly come again again.

  4. I’m really inspired with your writing abilities and also with the layout to
    your blog. Is that this a paid topic or did you modify it your self?
    Anyway stay up the nice high quality writing, it is uncommon to see
    a nice blog like this one these days..

  5. First of all I would like to say excellent blog!
    I had a quick question that I’d like to ask if you do not mind.
    I was interested to find out how you center yourself and clear
    your mind before writing. I have had a hard time clearing my thoughts in getting my ideas out.
    I do enjoy writing but it just seems like the first 10 to 15
    minutes are generally lost just trying to figure out how
    to begin. Any recommendations or tips? Kudos!

  6. Pretty great post. I simply stumbled upon your blog and wished to mention that I have truly loved surfing around your weblog posts.

    In any case I will be subscribing on your feed and I’m hoping you write once more soon!

  7. My spouse and I stumbled over here by a different web page and thought I should check
    things out. I like what I see so i am just following you.
    Look forward to looking into your web page again.

  8. naturally like your website however you need to take a look at the spelling on quite a few of your posts. A number of them are rife with spelling issues and I find it very troublesome to tell the truth however I?¦ll surely come again again.

  9. An interesting discussion is value comment. I think that you should write extra on this subject, it won’t be a taboo topic but generally persons are not enough to talk on such topics. To the next. Cheers

  10. [url=]buy silagra online uk[/url] [url=]viagra online india pharmacy[/url] [url=]cost of cialis generic[/url] [url=]gabapentin 300 mg price in india[/url] [url=]celebrex medication cost[/url] [url=]suhagra 25 mg[/url] [url=]suhagra 50 online[/url] [url=]cheap prednisolone tablets[/url]

  11. I have been looking for articles on these topics for a long time. casinocommunity I don’t know how grateful you are for posting on this topic. Thank you for the numerous articles on this site, I will subscribe to those links in my bookmarks and visit them often. Have a nice day


Leave a Comment