Skip to content

Commit da3cbb8

Browse files
committedMar 5, 2019
fix toString of EHB
1 parent 1aefaed commit da3cbb8

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed
 

‎dist/bigbit.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/bigbit.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bigbit",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"description": "Implementation of BigBit standard for numeric data type and character encoding",
55
"main": "index.js",
66
"scripts": {

‎src/EHB/ByteBit.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,12 @@ function ByteBit( decimal , options){
209209
return bArr;
210210
}
211211

212-
this.toExponentString = function(range){
213-
return toBigNumber( this.toByteArray() ).toExponential(range);
212+
this.toExponentString = function(range, limit=64){
213+
return toBigNumber( this.toByteArray() ,0,limit).toExponential(range);
214214
}
215215

216-
this.toString = function(){
217-
return toBigNumber( this.toByteArray() ).toFixed();
216+
this.toString = function(limit=64){
217+
return toBigNumber( this.toByteArray() ,0,limit).toFixed();
218218
}
219219

220220
}

‎static/tags/num_display.tag.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
}else{
6666
ehb = new EHB(num);
6767
ehbByteArr = ehb.toByteArray();
68-
ehb = ehb.decode(ehbByteArr , 0, 449).toFixed();
68+
ehb = ehb.toString(449);
6969
}
7070
}catch(e){
7171
ehb = "Processing such a big number can freeze the browser. Use the library directly.";

0 commit comments

Comments
 (0)
Please sign in to comment.