]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
audio gain: round the values
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Wed, 12 Jan 2022 07:48:47 +0000 (13:18 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Wed, 12 Jan 2022 07:48:47 +0000 (13:18 +0530)
rigctl.c

index a3faded93711dfe52df5873bec035d71b8142b7a..74d23e27ff115507995242e0ac5db8ef282c2bf6 100644 (file)
--- a/rigctl.c
+++ b/rigctl.c
@@ -954,12 +954,12 @@ gboolean parse_extended_cmd(char *command, CLIENT *client) {
       if (command[4] == ';') {
         // send reply back
         memset(reply, '\0', 9);
-        sprintf(reply, "ZZAG%03d;", (int)(active_receiver->volume * 100.0));
+        sprintf(reply, "ZZAG%03d;", (int) round(active_receiver->volume * 100.0));
         send_resp(client->fd, reply);
       } else if (command[7] == ';') {
           command[7] = '\0';
           int gain = strtol(&command[4], NULL, 10);
-          active_receiver->volume = (double)gain / 100.0;
+          active_receiver->volume = (double)gain / 100.0f;
           update_af_gain();
       }
       break;