mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-22 20:23:12 +03:00
fix(server): correct currency conversion with large numbers and rounding
Some checks failed
Create and publish a Docker image / build-and-push-server (push) Has been cancelled
Create and publish a Docker image / build-and-push-chart (push) Has been cancelled
Create and publish a Docker image / build-and-push-CR (push) Has been cancelled
Deploy docs / deploy (push) Has been cancelled
Some checks failed
Create and publish a Docker image / build-and-push-server (push) Has been cancelled
Create and publish a Docker image / build-and-push-chart (push) Has been cancelled
Create and publish a Docker image / build-and-push-CR (push) Has been cancelled
Deploy docs / deploy (push) Has been cancelled
This commit is contained in:
parent
20773385f4
commit
3720c3d66f
1 changed files with 1 additions and 3 deletions
|
@ -17,9 +17,7 @@ async function getDay(from_currency, conv_currency, date, conv_amount) {
|
|||
|
||||
if (conv_amount) {
|
||||
let conv_rate = data?.['rows'][0]['rate'] * conv_amount;
|
||||
const point = conv_rate.toString().indexOf('.') + 4;
|
||||
|
||||
data['rows'][0]['conv_amount'] = Number(conv_rate.toString().slice(0, point));
|
||||
data['rows'][0]['conv_amount'] = Number(conv_rate.toFixed(2));
|
||||
}
|
||||
|
||||
logger.debug(data['rows'][0]);
|
||||
|
|
Loading…
Add table
Reference in a new issue