From 324e83408317e3a4e2a7f5b3534698245810b975 Mon Sep 17 00:00:00 2001 From: Svallinn <41585298+Svallinn@users.noreply.github.com> Date: Wed, 9 Jun 2021 00:59:53 +0100 Subject: [PATCH] Settings: Round `defaultVolume`'s getter value to the nearest integer This fixes a bug related to the presentation of the `defaultVolume` value in its respective label in the Settings view. Since the value stored in the database and in the in-memory store is a decimal number, it is subject to floating point arithmetic related limitations. Example (processed by the V8 engine): 0.28 * 100 = 28.000000000000004 --- src/renderer/components/player-settings/player-settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/player-settings/player-settings.js b/src/renderer/components/player-settings/player-settings.js index 5e49d074..54555a55 100644 --- a/src/renderer/components/player-settings/player-settings.js +++ b/src/renderer/components/player-settings/player-settings.js @@ -67,7 +67,7 @@ export default Vue.extend({ }, defaultVolume: function () { - return parseFloat(this.$store.getters.getDefaultVolume) * 100 + return Math.round(parseFloat(this.$store.getters.getDefaultVolume) * 100) }, defaultPlayback: function () {