Mining-Profit  > API&Tools  >  Bitcoin Converter

Bitcoin Converter External Module

Description

If you embed our plug in onto your website you will acquire such a comfortable tool:

This plugin will help you to add a convenient and simple BTC/USD converter to your website, so that your customers will not just stay updated regarding the bitcoin exchange rates, but also convert any amount of BTC to USD.

The Converter works in two directions. In case you enter a price, you will get a bitcoin quantity on the left field.

The module memorizes the converting direction. Thus, if the BTC/USD exchange rate changes, the number you inserted will remain the same.

Quick Connection

  1. <script src="https://mining-profit.com/js/simple-converter.js"></script>
  2. <script type="text/javascript">
  3.     MiningProfitConverter.draw();
  4. </script>

MiningProfitConverter.draw() function shows converter in the place where it was summoned.

Converter Settings

All the features are optional. In case of module embedding without any custom settings (Quick Connection), , the converter will appear in its official theme Mining-Profit.com. You can see the example in the top website panel.

All settings should be customized before you run converter rendering function (MiningProfitConverter.draw()).

MiningProfitConverter.setStartCountBTC(string StartCountBitcoin);

The amount of bitcoins that will be used at the module boot.

Default: '1'.

Examples:

  1. MiningProfitConverter.setStartCountBTC('10');
  2. //or
  3. MiningProfitConverter.setStartCountBTC('5.5');

MiningProfitConverter.setCustomHeightConv(int CustomHeight);

The Converter height in pixels. In accordance with the height all the other Converter dimentions will be adjusted. Also, you can scale the module with the help of this option.

Default: 44.

Examples:

  1. MiningProfitConverter.setCustomHeightConv(30);
  2. //or
  3. MiningProfitConverter.setCustomHeightConv(55);

MiningProfitConverter.setCustomColorConv(string CustomColor);

The Converter color setting.

Default: '#428bca'.

Examples:

  1. MiningProfitConverter.setCustomColorConv('#428bca');
  2. //or
  3. MiningProfitConverter.setCustomColorConv('rgb(150, 150, 150)');

MiningProfitConverter.setFormatContainerBackground(string StyleFormatContainer);

Container color theme (the container of embedded Converter). There are 2 options StyleFormatContainer: 'dark' and 'light'.

The setting slightly affects the Converter theme details to improve the visual perception of dark or light container background.

Default: 'light'.

The Converter settings examples.

Light version

  1. <script type="text/javascript">
  2.   MiningProfitConverter.setStartCountBTC('10');
  3.   MiningProfitConverter.setCustomHeightConv(30);
  4.   MiningProfitConverter.setCustomColorConv('#6B916E');
  5.   MiningProfitConverter.setFormatContainerBackground('light');
  6.   MiningProfitConverter.draw();
  7. </script>

Dark version

  1. <script type="text/javascript">
  2.   MiningProfitConverter.setStartCountBTC('1');
  3.   MiningProfitConverter.setCustomHeightConv(46);
  4.   MiningProfitConverter.setCustomColorConv('#A72B13');
  5.   MiningProfitConverter.setFormatContainerBackground('dark');
  6.   MiningProfitConverter.draw();
  7. </script>