Barang | Jumlah | Harga satuan |
---|---|---|
CPU | 7 | 5500000 |
Printer | 5 | 1500000 |
Scaner | 8 | 2700000 |
Monitor | 10 | 3500000 |
Hardisk | 6 | 1200000 |
Mouse | 12 | 100000 |
Webcam | 15 | 1000000 |
Gunakan rumus di bawah ini :
awk 'BEGIN{printf "%-10s %-10s %-10s %-10s %-10s %s\n",
"BARANG","JUMLAH","HARGA SATUAN","TOTAL","DISCOUNT",
"BAYAR"}
{if($2>=5 && $2 <10){printf 4="$2*$3,$5=" 6="$4-$5">=10){printf "%-10s %-10s %-10s %-10s %-10s %s\n", $1,$2,$3,$4=$2*$3,$5=0.2*$4,$6=$4-$5 }}' diskon
Tidak ada komentar:
Posting Komentar