Skip to content

Commit

Permalink
bugfix:decimals
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Apr 12, 2024
1 parent 5b493b1 commit 4e5f7b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apollo/src/aggregation/aggregation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export class AggregationService extends PrismaClient implements OnModuleInit {
const { amount, sourceChainId, targetChainId, sourceToken, version } = params;
let transferDecimals = (value: string, decimals: number) => {
if (decimals > 0) {
return value.padEnd(value.length + decimals);
return value.padEnd(value.length + decimals, '0');
} else if (value.length + decimals > 0) {
return value.substr(0, value.length + decimals);
} else {
Expand Down
2 changes: 1 addition & 1 deletion apollo/src/lnbridgev20/lnbridgev20.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ export class Lnbridgev20Service implements OnModuleInit {

transferDecimals(value: string, decimals: number): string {
if (decimals > 0) {
return value.padEnd(value.length + decimals);
return value.padEnd(value.length + decimals, '0');
} else if (value.length + decimals > 0) {
return value.substr(0, value.length + decimals);
} else {
Expand Down

0 comments on commit 4e5f7b3

Please sign in to comment.