topkecleon / telegram-bot-bash

Telegram bot written in bash
Other
426 stars 123 forks source link

Wrong sleep syntaksis #172

Closed 0Karakurt0 closed 3 years ago

0Karakurt0 commented 3 years ago
Try 'sleep --help' for more information.
sleep: invalid time interval '2,5'

This is what I've got when launched bot in debug mode. There should be dot instead

gnadelwartz commented 3 years ago

hm, this looks like a LANG problem, whats your language setting?

what's the output of (include possible errors):

LC_ALL=C.utf-8 printf "%.1f\n" "2.47";
printf "%.1f\n" "2.47";
gnadelwartz commented 3 years ago

I guess it's because locale C is not installed on your system and you use a local where , is the decimal seperator like in german or other european languages. This should fix it for the next release: fe1fb757481f36233f3ad30bb394555c1ca4c488

# to fix it temporary in your bot change:
_round_float() {
        local digit="$2";
...
# to:

_round_float() {
        local digit="0";
...