diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-10-14 22:57:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-14 22:57:41 +0200 |
commit | b6f24ef0fb8b594c38c29090518c21af051b63b7 (patch) | |
tree | 5cec6a6b13dfd062848c74ae8e041c589ae40d00 /app/javascript/flavours/glitch/util | |
parent | ebf2c3195615bb524f6908e84f99887c8775cbc3 (diff) | |
parent | 6964952d5f242ca936de9df361185b3e70a99ca4 (diff) |
Merge pull request #1622 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/javascript/flavours/glitch/util')
-rw-r--r-- | app/javascript/flavours/glitch/util/numbers.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/util/numbers.js b/app/javascript/flavours/glitch/util/numbers.js index 6f2505cae..6ef563ad8 100644 --- a/app/javascript/flavours/glitch/util/numbers.js +++ b/app/javascript/flavours/glitch/util/numbers.js @@ -69,3 +69,11 @@ export function pluralReady(sourceNumber, division) { return Math.trunc(sourceNumber / closestScale) * closestScale; } + +/** + * @param {number} num + * @returns {number} + */ +export function roundTo10(num) { + return Math.round(num * 0.1) / 0.1; +} |