CoinTools Update: v0.0.9, Specify Amount + Reverse Cryptocurrency Calculation

in #utopian-io6 years ago (edited)

Introduction

CoinTools is a handy gadget to Chrome browser that you can launch easily to view the information of cryptocurrency.

Previous Contributions

Technology Stacks

Javascript that runs in Chrome.

Github

https://github.com/DoctorLai/CoinTools

Chrome Webstore

It is available online at Chrome Webstore:
https://chrome.google.com/webstore/detail/coin-tools/fmglcggbdcbkpkfapngjobfeakehpcgj

v0.0.9 Feature

Along with some UI localizations, enhanced error handling, this version allows users to reverse calculate the cryptocurrency pair and specify the amount in the conversion.

Screenshots

Specify negative numbers means reverse calculation:
image.png

and you can specify these formats:
image.png

that will fulfill the equations when APP starts up.
image.png

Commits

Here

Javascript Solves Cryptocurrency Equations

The following solves either x A = ? B or ? A = x B.

let a = pair[0].trim().toUpperCase();
let b = pair[1].trim().toUpperCase();
let c = pair[2].trim().toUpperCase();
// e.g. 100 BTC SBD
if (isNumeric(a) && isValidSymbol(b) && isValidSymbol(c)) {
    let dom = $('div#conversion_results');
    let dom_id = "cc_" + removeInvalid(a) + "_" + removeInvalid(b) + "_" + removeInvalid(c);
    dom.append('<div id="' + dom_id + '"> </div>');
    getConversion(b, c).then(x => {
        $('div#' + dom_id).html("<h4>" + a + " " + b.toUpperCase() + " = <span class=yellow>" + (x * a) + "</span> " + c.toUpperCase() + "</h4>");
    });
} else if (isNumeric(b) && isValidSymbol(a) && isValidSymbol(c)) {
    // e.g. BTC 100 SBD
    let dom = $('div#conversion_results');
    let dom_id = "cc2_" + removeInvalid(a) + "_" + removeInvalid(b) + "_" + removeInvalid(c);
    dom.append('<div id="' + dom_id + '"> </div>');
    getConversion(a, c).then(x => {
        $('div#' + dom_id).html("<h4>" + (b * 1.0 / x) + " " + a.toUpperCase() + " = <span class=yellow>" + (b) + "</span> " + c.toUpperCase() + "</h4>");
    });
} else {
    logit(get_text('error', "Error") + ": " + a + ", " + b + ", " + c);
}

Roadmap of CoinTools

Any good suggestions, please shout at @justyy.

License

MIT

Contribution Welcome

Github: https://github.com/DoctorLai/CoinTools/

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request.

Chrome Webstore

Install the CoinTools Now!



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

I think this should work well on mobile also? A, for now, I rely solely on cointelegraph and new.bicoin for information regarding crypto.

unfortunately, this only works in desktop chrome browsers.

Thank you for the contribution. It has been approved.

You can contact us on Discord.

[utopian-moderator]

看你发过steemit相关收益的文章,不知道现在怎么样?新加入这个平台,也关注你个人公众号了

Hey @justyy I am @utopian-io. I have just upvoted you!

Achievements

  • WOW WOW WOW People loved what you did here. GREAT JOB!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.28
TRX 0.11
JST 0.031
BTC 68960.63
ETH 3748.07
USDT 1.00
SBD 3.68