Skip to content

Commit

Permalink
fix: 퍼센트 api 로직 에러 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungGwan123 committed Nov 22, 2024
1 parent 8c796c4 commit 0959c71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/server/src/trade/trade-ask.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class AskService implements OnModuleInit {
}
})
if(!asset) return 0;
return asset.quantity * (percent / 100);
return parseFloat((asset.quantity * (percent / 100)).toFixed(8));
}
async createAskTrade(user, askDto) {
if(askDto.receivedAmount * askDto.receivedPrice < 5000) throw new BadRequestException();
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/trade/trade-bid.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class BidService implements OnModuleInit {
async calculatePercentBuy(user, moneyType: string, percent: number) {
const money = await this.accountRepository.getMyMoney(user, moneyType);

return Number(money) * (percent / 100);
return parseFloat((money * (percent / 100)).toFixed(8));
}
async createBidTrade(user, bidDto) {
if(bidDto.receivedAmount * bidDto.receivedPrice < 5000) throw new BadRequestException();
Expand Down

0 comments on commit 0959c71

Please sign in to comment.