Skip to content

Commit

Permalink
fix floating point rounding issue on large gas claims
Browse files Browse the repository at this point in the history
  • Loading branch information
Ejhfast committed Aug 1, 2017
1 parent 3a8cc00 commit adb7aa5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/wallet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export const transferTransaction = ($coin, $publicKeyEncoded, $toAddress, $Amoun
//data.set(hexstring2ab($coin['assetid']), inputLen + 4);

// output value
const num1 = $Amount * 100000000;
const num1 = parseInt($Amount * 100000000);
const num1str = numStoreInMemory(num1.toString(16), 16);
data.set(hexstring2ab(num1str), inputLen + 36);

Expand All @@ -348,7 +348,7 @@ export const transferTransaction = ($coin, $publicKeyEncoded, $toAddress, $Amoun
//data.set(hexstring2ab($coin['assetid']), inputLen + 4);

// output value
const num1 = $Amount * 100000000;
const num1 = parseInt($Amount * 100000000);
const num1str = numStoreInMemory(num1.toString(16), 16);
data.set(hexstring2ab(num1str), inputLen + 36);

Expand All @@ -363,7 +363,7 @@ export const transferTransaction = ($coin, $publicKeyEncoded, $toAddress, $Amoun
//data.set(hexstring2ab($coin['assetid']), inputLen + 64);

// output value
const num2 = inputAmount * 100000000 - num1;
const num2 = parseInt(inputAmount * 100000000 - num1);
const num2str = numStoreInMemory(num2.toString(16), 16);
data.set(hexstring2ab(num2str), inputLen + 96);

Expand Down

0 comments on commit adb7aa5

Please sign in to comment.