Article 5KK3V Arithmetic operation in bash script, multiply by decimal number, how?

Arithmetic operation in bash script, multiply by decimal number, how?

by
postcd
from LinuxQuestions.org on (#5KK3V)
GNU bash, version 5.1.8(1)

How can i please do this in a bash script, i want to multiply certain number by decimal number 1.5

Non working attempts:

1)

Code:result=$(( $number * 1.5 |bc -l ))
^---------------^ SC2004: $/${} is unnecessary on arithmetic variables.
^-^ SC2079: (( )) doesn't support decimals. Use bc or awk.
^-- SC2154: bc is referenced but not assigned (for output from commands, use "$(bc ...)" ).
^-- SC2154: l is referenced but not assigned.
Code:2)
```
result=$(( $number * 1,5 ))
^---------------^ SC2004: $/${} is unnecessary on arithmetic variables.3)

Code:#!/bin/bash
number=3456
result=$( echo "$number*1.5"|bc )
echo "$result"output is decimal (5184.0) which i do not want, i want whole numbers only resultlatest?d=yIl2AUoC8zA latest?i=6JxLxqa7TGs:6EmVlGqsaWc:F7zBnMy latest?i=6JxLxqa7TGs:6EmVlGqsaWc:V_sGLiP latest?d=qj6IDK7rITs latest?i=6JxLxqa7TGs:6EmVlGqsaWc:gIN9vFw6JxLxqa7TGs
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments