change expionential numbers in normal notation in given file
This commit is contained in:
parent
ed19ae5c0d
commit
71cf1ec44c
11
gaboshlib/g_num_exponential2normal_file.sh
Normal file
11
gaboshlib/g_num_exponential2normal_file.sh
Normal 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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user