var-name-fix

This commit is contained in:
olli 2024-07-08 11:09:52 +02:00
parent 9bc3710c32
commit 5c930248eb

View File

@ -5,16 +5,16 @@ function g_num_exponential2normal {
if [[ "$1" =~ e-[0-9] ]] if [[ "$1" =~ e-[0-9] ]]
then then
# convert # convert
printf -v f_g_num_exponential2normal_result -- "%.12f" "$1" printf -v g_num_exponential2normal_result -- "%.12f" "$1"
# remove ending 0 # remove ending 0
if [[ $f_g_num_exponential2normal_result =~ \. ]] if [[ $g_num_exponential2normal_result =~ \. ]]
then then
f_g_num_exponential2normal_result=${f_g_num_exponential2normal_result%%+(0)} g_num_exponential2normal_result=${g_num_exponential2normal_result%%+(0)}
f_g_num_exponential2normal_result=${f_g_num_exponential2normal_result%%.} g_num_exponential2normal_result=${g_num_exponential2normal_result%%.}
fi fi
return 0 return 0
else else
f_g_num_exponential2normal_result=$1 g_num_exponential2normal_result=$1
return 2 return 2
fi fi
} }