change expionential numbers in normal notation in given file

This commit is contained in:
olli 2024-10-21 10:39:34 +02:00
parent ed19ae5c0d
commit 71cf1ec44c

View File

@ -0,0 +1,11 @@
function g_num_exponential2normal_file {
# changes expionential numbers in normal notation in given file
local g_file=$1
local g_substitution g_exnum
for g_exnum in $(egrep -o -i "[0-9]+\.[0-9]+e[\+\-][0-9]+" "$g_file" | sort -u)
do
g_num_exponential2normal $g_exnum && g_substitution="${g_substitution}s/${g_exnum}/${g_num_exponential2normal_result}/g;"
done
sed -i "${g_substitution}" "$g_file" && return 0
}