37
rated 0 times
[
37]
[
0]
/ answers: 1 / hits: 164922
/ 2 Years ago, sat, october 29, 2022, 2:52:40
A quick example of what I want using bash scripting:
#!/bin/bash
echo "Insert the price you want to calculate:"
read float
echo "This is the price without taxes:"
echo "scale=2; $float/1.18" |bc -l
read -p "Press any key to continue..."
bash scriptname.sh
Assuming that the price is: 48.86
The answer will be:41.406779661 (41.40 actually because I'm using scale=2;
)
My Question is:
How I round the second decimal to show the answer in this way?: 41.41
More From » bash