Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Small fix - remove excess number conversion in helper
Browse files Browse the repository at this point in the history
  • Loading branch information
hlomzik committed Mar 4, 2024
1 parent ca32461 commit b6e4835
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion e2e/tests/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ const convertToFixed = (data, fractionDigits = 2) => {
if (['string', 'number'].includes(typeof data)) {
const n = Number(data);

return Number.isNaN(n) ? data : Number.isInteger(n) ? n : +Number(n).toFixed(fractionDigits);
return Number.isNaN(n) ? data : Number.isInteger(n) ? n : +n.toFixed(fractionDigits);
}
if (Array.isArray(data)) {
return data.map(n => convertToFixed(n, fractionDigits));
Expand Down

0 comments on commit b6e4835

Please sign in to comment.