2015-02-26 15:54:49 +01:00
|
|
|
var assert = require('assert');
|
2017-01-26 10:24:14 +01:00
|
|
|
var utils = require('../packages/web3-utils');
|
2015-02-26 15:54:49 +01:00
|
|
|
|
2015-03-25 22:17:35 +01:00
|
|
|
describe('lib/utils/utils', function () {
|
2015-02-26 15:54:49 +01:00
|
|
|
describe('toDecimal', function () {
|
|
|
|
it('should return the correct value', function () {
|
2017-01-26 10:24:14 +01:00
|
|
|
|
2015-02-26 15:54:49 +01:00
|
|
|
assert.equal(utils.toDecimal("0x3e8"), '1000');
|
|
|
|
// allow compatiblity
|
|
|
|
assert.equal(utils.toDecimal(100000), '100000');
|
|
|
|
assert.equal(utils.toDecimal('100000'), '100000');
|
|
|
|
});
|
|
|
|
});
|
2015-03-08 18:18:52 +01:00
|
|
|
});
|