0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 14:48:03 +03:00

slowly completing MDC1200 (TX and RX)

This commit is contained in:
OneOfEleven
2023-10-24 04:43:26 +01:00
parent 35ba988657
commit 3441f3afce
5 changed files with 196 additions and 46 deletions

17
misc.c
View File

@ -346,8 +346,19 @@ void NUMBER_trim_trailing_zeros(char *str)
{
if (str != NULL)
{
int i = (int)strlen(str) - 1;
while (i > 0 && (str[i] == '0' || str[i] == ' ') && str[i - 1] != '.')
str[i--] = 0;
bool found_dp = false;
int i = 0;
while (i < 16 && str[i] != 0)
{
if (str[i] == '.')
found_dp = true;
i++;
}
if (found_dp)
{
i--;
while (i > 0 && (str[i] == '0' || str[i] == ' ') && str[i - 1] != '.')
str[i--] = 0;
}
}
}