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

This commit is contained in:
Данил 2025-01-09 13:04:29 +03:00
parent 20773385f4
commit 3720c3d66f

View file

@ -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]);