mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-07 13:41:26 -07:00
Add helper function to convert to fixed-point string
This commit is contained in:
parent
60faba60ea
commit
19b8a52e44
2 changed files with 10 additions and 8 deletions
|
@ -161,3 +161,9 @@ function safeTrim(value) {
|
|||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
function toFixedPointString(number, digits) {
|
||||
// Do not round up number
|
||||
const power = Math.pow(10, digits);
|
||||
return (Math.floor(power * number) / power).toFixed(digits);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue