SHARE
TWEET

Untitled

a guest Apr 21st, 2017 49 in 1 day
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. user@local:~/excel$ perc=0,6373
  2. user@local:~/excel$ clean_input=$(echo $perc | sed 's/,//')
  3. user@local:~/excel$ divided=$(bc <<< "scale=2; $clean_input / 10")
  4. user@local:~/excel$ dot_formatted=$(printf "%05.2f%%" $divided)
  5. user@local:~/excel$ comma_formatted=$(echo $dot_formatted | sed s/\./,/)
  6. user@local:~/excel$ echo $comma_formatted
  7. ,37.30%
  8. user@local:~/excel$ echo $clean_input
  9. 06373
  10. user@local:~/excel$ echo $divided
  11. 637.30
  12. user@local:~/excel$ echo $dot_formatted
  13. 637.30%
RAW Paste Data
Top