Skip to content

Fix amount output when minority more then 100 #625

Merged
merged 5 commits into from
May 8, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix amount output when minority more then 100
Не знаю как у вас)
но конструкция `Math.log(1000) / Math.LN10` от 1000 выдаст `2.99999999996`
Отсюда кажется конструкция в целом оверхедом...почему бы просто не взять .log10 от числа
  • Loading branch information
romanlex committed Apr 12, 2018
commit 3ff3dfb80a14b0100aeaacec01987fdd513cb0ea
2 changes: 1 addition & 1 deletion src/amount/amount.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function formatAmount(amount) {
code
}
} = amount;
let fractionDigits = Math.log(minority) / Math.LN10;
let fractionDigits = Math.log10(minority);

let isNegative = value < 0;

Expand Down