From bdaf28cff77a18fb37136ef68643e476b5151886 Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan Date: Wed, 12 Jan 2022 13:18:47 +0530 Subject: [PATCH] audio gain: round the values --- rigctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rigctl.c b/rigctl.c index a3faded..74d23e2 100644 --- 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; -- 2.45.2