-
-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathgimenz.js
More file actions
20 lines (18 loc) · 657 Bytes
/
gimenz.js
File metadata and controls
20 lines (18 loc) · 657 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const readline = require('readline')
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
})
function cashbackCounter(cb, price) {
return 'Rp. ' + Number((cb / 100) * price).toLocaleString('id');
}
rl.question('Price : ', (price) => {
rl.question('Casback : ', (cashback) => {
const result = cashbackCounter(cashback, price)
console.log('================[ Cashbac Counter ]================');
console.log('Price : ', 'Rp.', Number(price).toLocaleString('id'));
console.log('Cashback : ', cashback + '%');
console.log('Result : ', result)
rl.close();
});
});